You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ondra Babuljak <on...@seznam.cz> on 2004/11/05 09:41:53 UTC
log4j doesn't create backup files in web-app, the same code in pure java app works fine
Hi,
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
____________________________________________________________
http://www.bezpecnyinternet.cz
http://ad.seznam.cz/clickthru?spotId=80833
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org