Giter Club home page Giter Club logo

Comments (11)

wilx avatar wilx commented on June 18, 2024

The file rolling is only done when a logging event is logged. There is no independent timer to roll the files. This is definitely something that could be improved.

from log4cplus.

lwmonster avatar lwmonster commented on June 18, 2024

@wilx It seems not this reason, my server print out log 3 or 4 times every second. And once one log file was delayed, the following logs will be delayed too. eg.

-rw-r--r-- 1 resys resys  622301 7月   6 00:02 client_running.log.2015-07-05-23
-rw-r--r-- 1 resys resys  631277 7月   6 01:02 client_running.log.2015-07-06-00
-rw-r--r-- 1 resys resys  643454 7月   6 02:02 client_running.log.2015-07-06-01
-rw-r--r-- 1 resys resys  651104 7月   6 03:02 client_running.log.2015-07-06-02
-rw-r--r-- 1 resys resys  629211 7月   6 04:02 client_running.log.2015-07-06-03
-rw-r--r-- 1 resys resys  633569 7月   6 05:02 client_running.log.2015-07-06-04
-rw-r--r-- 1 resys resys  619077 7月   6 06:02 client_running.log.2015-07-06-05
-rw-r--r-- 1 resys resys  655482 7月   6 07:02 client_running.log.2015-07-06-06
-rw-r--r-- 1 resys resys  726445 7月   6 08:02 client_running.log.2015-07-06-07
-rw-r--r-- 1 resys resys  723866 7月   6 09:02 client_running.log.2015-07-06-08
-rw-r--r-- 1 resys resys  706012 7月   6 10:02 client_running.log.2015-07-06-09
-rw-r--r-- 1 resys resys  907280 7月   6 11:02 client_running.log.2015-07-06-10
-rw-r--r-- 1 resys resys  922084 7月   6 12:02 client_running.log.2015-07-06-11
-rw-r--r-- 1 resys resys  925613 7月   6 13:02 client_running.log.2015-07-06-12
-rw-r--r-- 1 resys resys  983667 7月   6 14:02 client_running.log.2015-07-06-13

from log4cplus.

wilx avatar wilx commented on June 18, 2024

Check the logged events time stamp in the files against the ctime of the file that you see from ls -l. If they are the same, then everything works as intended.

from log4cplus.

lwmonster avatar lwmonster commented on June 18, 2024

@wilx
The logged events time stamp is delayed too. see client_running.log.2015-07-06-14:

INFO 2015-07-06 15:02:23.116 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1436166139695 newest time:1436166139695"
INFO 2015-07-06 15:02:24.118 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1436166139695 newest time:1436166139695"
INFO 2015-07-06 15:02:25.120 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1436166139695 newest time:1436166139695"
INFO 2015-07-06 15:02:26.134 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1436166139695 newest time:1436166139695"

The logged events of 15:02:23 was output to 【client_running.log.2015-07-06-14】

from log4cplus.

lwmonster avatar lwmonster commented on June 18, 2024

And at the first few days of my server started, it works good; But actually, it was delayed slowly, like a lost time watch

from log4cplus.

lwmonster avatar lwmonster commented on June 18, 2024

see log of 2015-06-27-00: client_running.log.2015-06-27-00, the last logged event is:

INFO 2015-06-27 01:00:07.366 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1435337979101 newest time:1435337979101"

see log of 2015-06-30-00: client_running.log.2015-06-30-00, the last logged event is:

INFO 2015-06-30 01:00:54.116 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1435597253699 newest time:1435597253699"

see log of 2015-07-02-00: client_running.log.2015-07-02-00, the last logged event is:

INFO 2015-07-02 01:01:23.117 [client/UserItemClient.cpp:107] "UserItemClient::Run Get users finish, number:1 start time:1435770012435 newest time:1435770012435"

Time 01:00:07.366 -> 01:00:54.116 -> 01:01:23.117
The time was later and later, and some day, the logs will be delayed more than one hour

from log4cplus.

wilx avatar wilx commented on June 18, 2024

@lwmonster : Please test the branch (based on 1.2.x branch) linked above. I think this might fix the issue. I think the rollover time was getting skewed due to now time not getting rounded to whole minutes.

from log4cplus.

wilx avatar wilx commented on June 18, 2024

I have pushed another change to the branch which should fix the issue for other schedules as well.

from log4cplus.

lwmonster avatar lwmonster commented on June 18, 2024

ok, thank you, I will have a try ~
Thank you ~

from log4cplus.

lwmonster avatar lwmonster commented on June 18, 2024

@wilx I didn't upgrade it to 1.2.x, I just added the code of bug #92 and recompile it, it works; thank you very much~

from log4cplus.

wilx avatar wilx commented on June 18, 2024

Cool. I will apply to other branches as well.

from log4cplus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.