logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barbalace, Richard" <RBARBAL...@PARTNERS.ORG>
Subject DailyRollingFileAppender extensions...
Date Thu, 18 May 2006 15:10:31 GMT
Hello.

I am attempting to use a DailyRollingFileAppender with a logger.  I like the
concept, but the resulting formating of the file name is undesireable.

I am using a simple and common specification:
  log4j.appender.MONITOR=org.apache.log4j.DailyRollingFileAppender
  log4j.appender.MONITOR.File=logs/monitor.log
  log4j.appender.MONITOR.DatePattern='.'yyyy-MM-dd

Given a filename of "monitor.log", the DailyRollingFileAppender will copy this
to "monitor.log.2006-05-17", thereby altering the ".log" extension.  This is
inconsistent with all the other logs I have from Tomcat, such as
"catalina.2006-05-17.log" or "localhost.2006-05-17.log", and the change to the
extension is an annoyance.  The formating used by DailyRollingFileAppender is
unusual among the applications I have seen, so this must be a common problem.

Is there a way of getting DailyRollingFileAppender to recognize extensions and
insert the date format between the filename and the extension?

I considered using the following:
  log4j.appender.MONITOR.DatePattern='.'yyyy-MM-dd'.log'
But my understanding is that the file would then look like
"monitor.log.2006-05-17.log", which has an extension in the middle so it would
also be wrong.

Richard J. Barbalace
Software Developer
Harris Orthopaedics Biomechanics and Biomaterials Laboratory
Massachusetts General Hospital
55 Fruit Street, Jackson 1121
Boston, MA  02114
Tel: 617-726-3607
Fax: 617-726-3883


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message