• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Configuring Jboss log4j.xml file.

 
Prashant Karmankar
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 10444
227
IntelliJ IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prashant Karmankar
Greenhorn
Posts: 24
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic