logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roy Chastain" <...@roychastain.org>
Subject Using log4net.Util.PatternString in a PatternLayout
Date Wed, 07 May 2008 12:34:34 GMT
I have the following layout defined for a RollingFileAppender  (log4Net

<layout type="log4net.Layout.PatternLayout">
  <param name="Header" type="log4net.Util.PatternString"
value="%newline**** Trace Opened     Local: %date{yyyy-MM-dd
HH:mm:ss.fff}     UTC: %utcdate{yyyy-MM-dd HH:mm:ss.fff} ****%newline"
  <param name="Footer" type="log4net.Util.PatternString" value="****
Trace Closed %date{yyyy-MM-dd HH:mm:ss.fff} ****%newline" />
  <param name="ConversionPattern" value="%d{dd HH:mm:ss.fff} [%4t]
%P{instance}::%M - %m%n" />

The idea is to place the current date and time in the header and footer
of each log file as it rolls over.  Instead each header and footer
receives the same date/time.  (The date/time is the date/time the
original file was opened.)

This action is certainly not what was expected, and I do not believe a
useful implementation.

Can someone say that the result is has expected and, if so, please give
some pointers on how to implement a 'current date/time' for the headers
and footers?


Roy Chastain

View raw message