Comments (11)
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.
@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.
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.
@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.
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.
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.
@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.
I have pushed another change to the branch which should fix the issue for other schedules as well.
from log4cplus.
ok, thank you, I will have a try ~
Thank you ~
from log4cplus.
@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.
Cool. I will apply to other branches as well.
from log4cplus.
Related Issues (20)
- ./configure fails using c++2a HOT 3
- How to configure PatternLayout to use __FUNCTION__ HOT 7
- A link error occurred while compiling the my program. HOT 4
- Question: Effect of LOG4CPLUS_REQUIRE_EXPLICIT_INITIALIZATION on Windows? HOT 5
- Setting log level through env in log config file HOT 3
- Help needed: how to periodically flush logger with appender's immediateFlush set to false? HOT 2
- log file name not change after rollover TimeBasedRollingFileAppender HOT 3
- log's maxsize>200kb,but it dosen't work HOT 2
- Opentelemetry integration HOT 1
- What kind of compilation options can correctly generate a multi-threaded logging library HOT 5
- Win64 application crash on exit HOT 1
- Why mingw can't complie log4cplus-2.1.1? HOT 1
- Sending logs from log4cplus to log4j via TCP HOT 1
- Is it possible to build log4cplus for QNX aarch64le? HOT 3
- Save all configuration in a file HOT 2
- Question: Which latest version of Log4cplus I should use on RedHat 7.9 with DevToolset11-toolchain ( GCC 11.2 ) compiler HOT 7
- Does not work when maxBackupIndex is set to 0 HOT 1
- Include Headers Possibly Causing Build Error HOT 5
- how to set FD_CLOEXEC for log4cplus HOT 1
- Inconsistent Log File Permissions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from log4cplus.