Log4Net web.config


/ Published in: XML
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <log4net>
  2. <logger name="logger">
  3. <!--Loggers may be assigned levels. Levels are instances of the log4net.Core.Level class. The following levels are defined in order of increasing priority:
  4.  
  5. * ALL
  6. * DEBUG
  7. * INFO
  8. * WARN
  9. * ERROR
  10. * FATAL
  11. * OFF-->
  12.  
  13. <level value="ERROR"/>
  14. <appender-ref ref="RollingLogFileAppender" />
  15. <appender-ref ref="TraceAppender" />
  16. </logger>
  17.  
  18. <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
  19. <layout type="log4net.Layout.PatternLayout">
  20. <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
  21. </layout>
  22. </appender>
  23.  
  24. <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender,log4net">
  25. <param name="File" value="diagnostics.log" />
  26. <param name="AppendToFile" value="true" />
  27. <param name="MaxSizeRollBackups" value="10" />
  28. <param name="MaximumFileSize" value="5MB" />
  29. <param name="RollingStyle" value="Size" />
  30. <param name="StaticLogFileName" value="true" />
  31.  
  32. <layout type="log4net.Layout.PatternLayout,log4net">
  33. <header value="******************************************************&#xD;&#xA;********************* START **************************&#xD;&#xA;******************************************************&#xD;&#xA;" />
  34. <footer value="*********************** END **************************&#xD;&#xA;&#xD;&#xA;" />
  35. <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
  36. </layout>
  37. </appender>
  38. </log4net>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.