You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Barbalace, Richard" <RB...@PARTNERS.ORG> on 2006/05/18 17:10:31 UTC

DailyRollingFileAppender extensions...

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


Re: DailyRollingFileAppender extensions...

Posted by James Stauffer <st...@gmail.com>.
This is extensively discussed.  Options: log4j 1.3 or implement your
own appender (easy to do).

On 5/18/06, Barbalace, Richard <RB...@partners.org> wrote:
> 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
>
>


-- 
James Stauffer
Are you good? Take the test at http://www.livingwaters.com/good/

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