November 21, 2005

Modifying Config File for a Log4Net TraceAppender

Modifying an App.Config file for Log4Net Adding a TraceAppender:
  <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
  <layout type="log4net.Layout.PatternLayout">
    <conversionPattern value="%date{HH:mm:ss,fff}[%thread] %-5level %logger{2}:    

   %message%newline%exception" />
  </layout>
  </appender>
Setting a module to use the log to the TraceAppender and the ConsoleAppender
  <logger name="mymodule.comms">
    <level value="ALL" />
      <appender-ref ref="ConsoleAppender" />
  <appender-ref ref="TraceAppender" />
  </logger>

No comments: