logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karel Kral <kral.k...@volny.cz>
Subject RollingFileAppender: date based roll
Date Thu, 15 Feb 2007 11:52:26 GMT
Hello, is there any possibility to configure RollingFileAppender
(configured to roll every day) to use directory name based on current date?

I wish to log to 2007-02-15\test.log.2007-02-15

I have tested solution based on PatternString in file element (see
bellow), but it is not functional. The fileName pattern is parsed
exactly at program start and it never changes if program is running
through midnight.

<appender name="FileAppender" type="log4net.Appender.RollingFileAppender">
   <file value="%date{yyyy-MM-dd}\test.log"
      <appendToFile value="true" />
      <rollingStyle value="Date" />
      <datePattern value=".yyyy-MM-dd" />
Prostredi: VB.NET, VS2005 Pro, XP Pro/P4 3GHz, 2GB RAM
Karel Kral, vyvojar
ANETE, s.r.o.

View raw message