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.
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
posted
0
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.
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.