aspose file tools*
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
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: 9321
    
  17

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: 16305
    
  21

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:



Customer surveys are for companies who didn't pay proper attention to begin with.
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9321
    
  17

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