can log rotation be turned off?

Asked by Johnny Tan on 2012-05-23

Here's an example of how a carbon log is rotated:
-rw-r--r-- 1 root root 15261648 May 16 23:59 listener.log.2012_5_16
-rw-r--r-- 1 root root 15278109 May 17 23:59 listener.log.2012_5_17
-rw-r--r-- 1 root root 15276162 May 18 23:59 listener.log.2012_5_18
-rw-r--r-- 1 root root 15277401 May 19 23:59 listener.log.2012_5_19
-rw-r--r-- 1 root root 15275985 May 20 23:59 listener.log.2012_5_20
-rw-r--r-- 1 root root 15277401 May 21 23:59 listener.log.2012_5_21
-rw-r--r-- 1 root root 15180228 May 22 23:50 listener.log

Is there a way to turn off this rotation, such that logs simply go to (in the above example) "listener.log"?

That way, I can use Linux's logrotate and have it consistent with my other log rotations.

Otherwise, I'm stuck with doing a cron job to "find" and delete logs older than X days.


Question information

English Edit question
Graphite Edit question
No assignee Edit question
Solved by:
Michael Leinartas
Last query:
Last reply:
Best Michael Leinartas (mleinartas) said : #1

No, unfortunately there's currently no way to customize this. Better control of logging is something we've been meaning to get done for a while - feel free to report a bug to keep track of the feature

Johnny Tan (johnnydtan) said : #2

Thanks Michael Leinartas, that solved my question.

Jose Gonzalez (savant) said : #3

Cron job is what I ended up doing as well - y u no let us logrotate?

For historical purposes, here is what I did:

    0 */1 * * * root find $GRAPHITE_PATH/storage/log/carbon-cache/carbon-cache-a -name "*log.20*" |xargs rm
    0 */1 * * * root find $GRAPHITE_PATH/storage/log/webapp -name "*log.20*" | xargs rm

Should work until 2100.

Jens Rantil (jens-rantil) said : #4

Here's how I did it:

30 2 * * * find /var/log/carbon -type f -mtime +8 -delete