This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Log4j logging file housekeeping" Watch "Log4j logging file housekeeping" New topic

Log4j logging file housekeeping

Ravi Gupt

Joined: Oct 16, 2007
Posts: 17
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.

Peter Johnson

Joined: May 14, 2008
Posts: 5812

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
It is sorta covered in the JavaRanch Style Guide.
subject: Log4j logging file housekeeping
Similar Threads
Error starting up my jboss
Usage of the .sar file
server filesets in eclipse
Basic weblogic help
Jboss + Lomboz +Eclipse setup