dcsimg
log4j doesn't create backup files in web-app, the same code in pure java app works fine
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   ondra_babuljak
Posted On:   Sunday, October 31, 2004 11:48 PM

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"); r   More>>


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    <<Less
About | Sitemap | Contact