Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Amit Scybs
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Amit Scybs
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic