Skip to content

Instantly share code, notes, and snippets.

@tuudik
Last active May 25, 2017 08:26
Show Gist options
  • Save tuudik/1d00264265dc443e5e3a408c3b3c6f79 to your computer and use it in GitHub Desktop.
Save tuudik/1d00264265dc443e5e3a408c3b3c6f79 to your computer and use it in GitHub Desktop.
MISP2 log rotation
/var/log/tomcat6/*.out /var/log/tomcat6/orbeon.log.* /var/log/tomcat6/soap-messages.log {
daily
rotate 3650
size 10M
dateext
dateformat -%Y-%m-%d-%s.log
compress
notifempty
missingok
copytruncate
}
@tuudik
Copy link
Author

tuudik commented May 25, 2017

It's also recommended to switch the appender for orbeon, at the end of /var/lib/tomcat6/webapps/orbeon/WEB-INF/resources/config/log4j.xml, comment SingleFileAppender and uncomment RollingFileAppender. Also it's recommended to change priority value from debug to info and change MaxFileSize to 10MB.

...
    <appender name="RollingFileAppender" class="org.apache.log4j.RollingFileAppender">
        <param name="File" value="/var/log/tomcat6/orbeon.log"/>
        <param name="MaxFileSize" value="10MB"/>
...
  <!-- You decide here which one of the loggers listed above you want to use. -->
    <root>
        <priority value="info"/>
        <!--<appender-ref ref="ConsoleAppender"/>-->
        <!--<appender-ref ref="ChainsawAppender"/>-->
        <!--<appender-ref ref="SingleFileAppender"/>-->
        <appender-ref ref="RollingFileAppender"/>-->
    </root>

</log4j:configuration>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment