aspose file tools*
The moose likes JBoss/WildFly and the fly likes Configuring Jboss log4j.xml file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Configuring Jboss log4j.xml file." Watch "Configuring Jboss log4j.xml file." New topic
Author

Configuring Jboss log4j.xml file.

Prashant Karmankar
Greenhorn

Joined: Jul 10, 2008
Posts: 24
Hi,
jboss create new server.log file every mid-night and rename
old server.log in server.log.yy- mm-dd format.

how will i change this time to evening at 6pm. i.e i want to configure jboss log4j.xml to create new server.log file at 6pm every day and rename old
server.log in server.log.yy- mm-dd file.

Prashant K
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

Prashant,

Welcome to JavaRanch

how will i change this time to evening at 6pm


See the Javadocs of DailyRollingFileAppender.html which has an explanation about the DatePattern option.


[My Blog] [JavaRanch Journal]
Prashant Karmankar
Greenhorn

Joined: Jul 10, 2008
Posts: 24
Hi Jaikiran,
Thanks for your reply, i recently join this forum. i got answer and would like to thank you once again.

PrashantK
Sundaramoorthi Mayakrishnan
Greenhorn

Joined: Sep 07, 2008
Posts: 1
Hi Prashant Karmankar,

I am also looking for the same info. My jboss server updating the same log file every day. I want to have new log file genereated for everyday. Can you help me in this.

Thanks in Advance.
M.Sundaramoorthi
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5772
    
    7

Originally posted by Sundaramoorthi Mayakrishnan:
I want to have new log file genereated for everyday.


That is what the DailyRollingFileAppender does - if you leave the app server running, you should see that at midnight a new server log is created. But I suspect that what you are doing is stopping the app server at the end of the day and starting it again the next morning. In that case, the new server log simply overwrites the old server log.

There are other appenders that you can use. The Log4J documentation describes some of them. For others you will have to read the log4j javadocs. Also, many of the appenders you can configure to append new log information to the existing log file, rather than replacing the log file. Perhaps that will help accomplish you goal.

Note that JBossAS has an wrapper class for every Log4j appender. For example, the wrapper for org.apache.log4j.RollingFileAppender is org.jboss.logging.appender.RollingFileAppender. You should always use the JBossAS wrappers in the jboss-log4j.xml configuration file.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configuring Jboss log4j.xml file.
 
Similar Threads
Log4j logging file housekeeping
how to create daily server logs in jBoss
persist previous server.log after server restarts using log4j.xml
jboss-log4j.xml category question
server.log file