The moose likes Other Open Source Projects and the fly likes log4j problem: Multiple RollingFileAppender in an application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j problem: Multiple RollingFileAppender in an application" Watch "log4j problem: Multiple RollingFileAppender in an application" New topic
Author

log4j problem: Multiple RollingFileAppender in an application

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9434
    
  20

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)


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17142
    
  27

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:



An IDE is no substitute for an Intelligent Developer.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9434
    
  20

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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j problem: Multiple RollingFileAppender in an application
 
It's not a secret anymore!