logging-log4net-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Chamberlain" <Eric.Chamberl...@stratagen.com>
Subject Mystery concerning configuration
Date Thu, 18 Jun 2009 22:41:51 GMT
Greetings all,

 

I have an appender which works fine if specified with generic XML but
not when specified with conventional log4net terms in the configuration.

 

Examples should help:

 

The following works:

 

  <appender name="LogServiceAppender"

            type="log4net.Appender.RollingFileAppender">

    <param name="File"

           value="myfile.log" />

    <param name="AppendToFile"

           value="true" />

    <param name="MaxSizeRollBackups"

           value="10"/>

    <param name="MaximumFileSize"

           value="1MB"/>

    <param name="RollingStyle"

           value="Size"/>

    <param name="StaticLogFileName"

           value="true"/>

    <layout type="log4net.Layout.PatternLayout">

      <param name="ConversionPattern"

             value="%d{yyyy MMM dd HH:mm:ss} [%t] %-5p - %m%n" />

    </layout>

  </appender>

 

But the following does *not* work.  It fails to initialize (I turned on
the log4net debugging to see it).

 

  <appender name="LogServiceAppender"

            type="log4net.Appender.RollingFileAppender">

    <file value="myfile.log" />

    <appendToFile value="true"/>

    <maxSizeRollBackups value="10"/>

    <maximumFileSize value="1MB"/>

    <rollingStyle value="Size"/>

    <staticLogFileName value="true"/>

    <layout type="log4net.Layout.PatternLayout">

      <conversionPattern value="%d{yyyy MMM dd HH:mm:ss} [%t] %-5p -
%m%n" />

    </layout>

  </appender>

 

It appears that log4net initialization does not recognized its own XML
schema.   How is that possible?  

______________________________________________________________________

Eric Chamberlain


Mime
View raw message