How to rotate Tomcat Log file when it reached certain limit -


in windows can go go program files\apache software foundation\tomcat6.0\bin , run tomcat6w.exe administrator under java tab, in java options section add following: -djava.util.logging.filehandler.limit=25000000 set default stdout.log file 25mbs before rotates new log file. if configured log file not rotating size reached limit.

i believe $tomcat/logs/catalina.out cannot logrotated $tomcat/logs/mywebapp.log files possible in tomcat's default juli(javautilloginterface) implementation.

add mywebapp/web-inf/classes/logging.properties file webapps.

handlers = java.util.logging.filehandler  ## limit=kb of file, count=number of files kept     java.util.logging.filehandler.level = fine #org.apache.juli.filehandler.directory = ${catalina.base}/logs #org.apache.juli.filehandler.prefix = mywebapp. java.util.logging.filehandler.pattern = ${catalina.base}/logs/mywebapp.%g.log java.util.logging.filehandler.limit = 2000000  java.util.logging.filehandler.count = 5 java.util.logging.filehandler.formatter = java.util.logging.simpleformatter 

Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -