This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

log4j problem: Multiple RollingFileAppender in an application  RSS feed

 
Ankit Garg
Sheriff
Posts: 9609
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

I'm using three log4j RollingFileAppenders in my application and only the one which I declare last works others don't roll the file. Has anyone faced the same issue? If this is a known problem then is there a solution (there are no matching hits on google). Here's my log4j.xml (I've changed some of the names as per my company's NDA)
 
Tim Holloway
Bartender
Posts: 18548
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably you're rolling based on filesize, since you don't have a time-based policy in effect. So of course, if the logs stay under the threshold, they won't roll even if everything else is perfect.

Here's one of about 7 appenders I have in one app:

 
Ankit Garg
Sheriff
Posts: 9609
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I messed up with my words. The file actually rolls after the 20MB limit but the old logs don't get stored in a different file name i.e. the backup is not working...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!