I used logrotate to rotate my log files. The conf file look like this:
/data/log/web/12114.log {
daily
rotate 10
copytruncate
}
But logrotate doesn't cut the log file properly. The result log files look like this:
-rw-r--r-- 1 root root 0 12月 21 03:14 12114.log
-rw-r--r-- 1 root root 12806139570 12月 21 10:55 12114.log-20151217
-rw-r--r-- 1 root root 0 12月 17 03:13 12114.log-20151218
-rw-r--r-- 1 root root 0 12月 19 03:15 12114.log-20151219
-rw-r--r-- 1 root root 0 12月 20 03:28 12114.log-20151220
-rw-r--r-- 1 root root 0 12月 21 03:14 12114.log-20151221
Which means all the logs were written to 12114.log-20151217
, the
should-be file 12114.log-20151221
has no content.
Why could this happen? The log file were written from flask logger
utils
.
Thx in advance,