File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 5778

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