Tomcat Logging - Tomcat log rotation using Logrotate

Rotating Tomcat's Logs Via Logrotate
------------------------------------

Using logrotate: create a file named /etc/logrotate.d/tomcat with this in it:

/opt/tomcat/logs/catalina.out {
    copytruncate
    daily
    missingok
}

Note: If using the AJP Connector, set the attribute request.registerRequests="false"
to stop logging JMX stats for the requests of the connector, and performance
will stay steadier during traffic spikes.

To log "everything":

.level=ALL

The 1..n prefixes are meaningless. You just have to use a unique number.

To turn up JK protocol logging (on the Java side) to FINE:

org.apache.jk.level = FINE

Tomcat Logging

JspServlet logging:
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/].[jsp] = ALL

Disabling JULI log buffering:

1catalina.org.apache.juli.FileHandler.bufferSize=-1
2localhost.org.apache.juli.FileHandler.bufferSize=-1
3manager.org.apache.juli.FileHandler.bufferSize=-1
4host-manager.org.apache.juli.FileHandler.bufferSize=-1
 

Comments on this post:
 #

How do I add resources to this page?

 

Post new comment

The content of this field is kept private and will not be shown publicly.

Download Tcat Server - Tomcat Simplified

Develop, diagnose, manage, configure, and deploy your Apache Tomcat applications with ease, and break free from bloated legacy JEE app servers. Built on 100% Tomcat, with no changes to the core code, Tcat Server is free for developers, and there is no commitment required. Try it now, risk-free! 
 

click thumbnail to enlarge

Link to this page

Sign up for our Newsletter!