Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat log4j dosn't roll files as supposed to

 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 18025
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
Meir Yan
Ranch Hand
Posts: 599
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic