File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes log4j doesn't create backup files in web-app, the same code in pure java app works fi Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "log4j doesn Watch "log4j doesn New topic
Author

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

Ondra Babuljak
Greenhorn

Joined: Nov 05, 2004
Posts: 2
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:





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
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
What do you mean about "backup files" ?


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Ondra Babuljak
Greenhorn

Joined: Nov 05, 2004
Posts: 2
Originally posted by somkiat puisungnoen:
What do you mean about "backup files" ?


When the log file reaches the size specified in .setMaxFileSize(size) it should make a backup of the log file (number of backups is set by .setMaxBackupIndex(backupIndex)) and roll over the log file -> in this case the file app.log should be copied to app.log.1 and further logging should be written to rolled over file app.log
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
In my project, I'm just config in log4j.properties BUT not in my code like you. And my program is work fine.


Sometime, you can check permission in target directory for crete log file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: log4j doesn't create backup files in web-app, the same code in pure java app works fi
 
Similar Threads
Help Please -log4j:WARN No appenders could be found for logger
Log4j : How to name the logfile dynamically
Log4j will not write to log file.
log4j in jboss
log4j DailyRollingFileAppender