For some reason our tomcatlogs are being appended with a .1 when logrotate runs. e.g: file "tcl-2013-08-16.0.log" becomes "tcl-2013-08-16.0.1.log". I am struggling to find what setting is adding the ".1" before the ".log" part of the file name. Below is a copy of the settings file from /etc/logrotate.d/:

    extension .log
    rotate 52
    daily
    nocreate
    nodateext
    missingok
    notifempty
    compress
    delaycompress

Below is the config in /etc/logrotate.conf:

    weekly
    rotate 52  
    create  
    dateext  
    compress  
    delaycompress  
    include /etc/logrotate.d

What am I missing here?

Thanks, Nath

有帮助吗?

解决方案

If you look at the copy of the settings file from /etc/logrotate.d/", you will find there is this option extension .log.

This option means you are trying to append the .log extension to rotated files. If you remove this option and run logrotate again, you will find that by default the extension will be *.log.1 , *.log.2, and so on for the rotated files.

In a nutshell, remove the option extension .log. Because the rotated files will take .log as extension.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top