aspose file tools*
The moose likes Other Open Source Projects and the fly likes persist previous server.log after server restarts using log4j.xml 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 "persist previous server.log after server restarts using log4j.xml" Watch "persist previous server.log after server restarts using log4j.xml" New topic
Author

persist previous server.log after server restarts using log4j.xml

Amit Scybs
Greenhorn

Joined: Aug 03, 2009
Posts: 2
I am using JBOSS 4.3 and need to store the server.log after server get restarted. It does create a backup file daily but we dont need to override the existing server.log in a day if server gets restarted.changing append to true doesnt look like an option for me.

Jboss using this Appender from log4j.xml

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10263
    
168

Changing the Append=true should give you what you are looking for. Are you sure, you are changing this at the correct place? Remember that the jboss log4j.xml file has a commented out FILE appender too. So make sure you are changing this property in the uncommented FILE appender


[My Blog] [JavaRanch Journal]
Amit Scybs
Greenhorn

Joined: Aug 03, 2009
Posts: 2
I am changing it at the right place and can see the change getting reflected.

But because of some limitation I cant use the append property. I am wondering, this is what something so strange I am asking. This makes complete sense to be just rename (using standard backup filename format) the existing log file and create a new log file.

Any help will be greatly appreciated.

Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10263
    
168

This makes complete sense to be just rename (using standard backup filename format) the existing log file and create a new log file.


That functionality isn't available in log4j. The only way, i know, of persisting the logs on restarts is to use the append property.

Since we are discussing about log4j and its feature, i am going to move this to our "Other open source projects" forum where ranchers with more experience on log4j might be able to help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: persist previous server.log after server restarts using log4j.xml