This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Log4j logging file housekeeping Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » JBoss/WildFly
Reply Bookmark "Log4j logging file housekeeping" Watch "Log4j logging file housekeeping" New topic
Author

Log4j logging file housekeeping

Ravi Gupt
Greenhorn

Joined: Oct 16, 2007
Posts: 15
Hi Guys,

I have a requirement that on each jboss server restart it should create a new myServer.log file and it should rename old file to myServer_DDMMYY_HHMMSS.log

for example: I have created a RollingFileAppender for myServer.log in jboss-log4j.xml, what changes should I do in this configuration so that it archives(renames) existing file and create a new myServer.log on each server re-start.


Thanks,
Ravi
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5575

Add some code to the startup script to do this; there is no Log4J configuration option that will do this for you.


JBoss In Action
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Log4j logging file housekeeping
 
Similar Threads
Jboss + Lomboz +Eclipse setup
Usage of the .sar file
Error starting up my jboss
Basic weblogic help
server filesets in eclipse