Two Laptop Bag*
The moose likes Tomcat and the fly likes Tomcat log4j dosn't roll files as supposed to Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat log4j dosn Watch "Tomcat log4j dosn New topic

Tomcat log4j dosn't roll files as supposed to

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
i have in my tomcat web application log4j that is configured like this :

configured 100kb just to get quick test results , any way it seams like log4j roll the log only once and each time he detects that he need to make roll it just changes the previous file name and keep outputting to the main log file , i set log4j debug mode and the output it gives me looks like this :

as you can see it renaming me the myapp_gw.log.8 to myapp_gw.log.9 but doesn't keep the myapp_gw.log.8 ,
i need it to keep as i configured history of 15 files . what i need wrong here ?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952

Tomcat doesn't have anything to do with this. When applications log, they take full responsibility for their own logging.

Here's an appender config that works for me, though:

Customer surveys are for companies who didn't pay proper attention to begin with.
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
Hi and thanks for the reply , well from what i see your configuration is like my . except i dont need time based rolling only size of file based rolling
and this configuration used to work before very well i dont know why in this tomcat web app it acting like this .
also the logging doesn't give me much info
Consider Paul's rocket mass heater.
subject: Tomcat log4j dosn't roll files as supposed to
Similar Threads
log4j problem: Multiple RollingFileAppender in an application
log4j.xml configuration for configuring input from specific file only to consider logging.
Want to seperate Logs in Info and Error
How Can I log my pintStackTrace () statement into log file?
Getting log4j to write to multiple log files