Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

log4j doesn't create backup files in web-app, the same code in pure ja

Status
Not open for further replies.

ondrabab

Programmer
Nov 4, 2004
4
CZ
Hi all,

in my application I have a class DummyLogger, which is a superclass to all others. It provides them a log4j Logger.



In the constructor it sets up the important attributes:


log = Logger.getLogger(name+" (" + app + ") ");
log.setLevel(Level.toLevel(level));

PatternLayout defaultLayout = new PatternLayout("%p %c,line %L,%d{dd.MM.yyyy/HH:mm:ss},%m%n");

RollingFileAppender rollingFileAppender = new RollingFileAppender();
rollingFileAppender.setName(name);
rollingFileAppender.setFile(path+app+".log", true, false, 0);
rollingFileAppender.setMaxFileSize("10MB");
rollingFileAppender.setMaxBackupIndex(5);
rollingFileAppender.setLayout(defaultLayout);

log.removeAllAppenders();
log.addAppender(rollingFileAppender);
log.setAdditivity(false);




Formerly I had the application as a pure java app and everything worked fine. Now I've made it a web application (I run it on WebsphereAS 5.0) and it has stopped creating the backup files. However the code remained the same.
Any ideas what has happend?



Thanks a lot,
Ondra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top