log4net
on Start:
log4net.Config.XmlConfigurator.Configure();
Debugging:
First you have to set this value on the application configuration file:
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings></configuration>
Then, to determine the file in which you want to save the output you can add the following code in the same .config file:<configuration>
...
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add
name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="C:\tmp\log4net.txt" />
</listeners>
</trace></system.diagnostics>
...
</configuration>
You can find a more detailed explanation looking for 'How do I enable log4net internal debugging?' in the log4net FAQ page:Config for Log File:
< appender name =" AvgFileAppender" type="log4net.Appender.RollingFileAppender" >
< file value =" .\\App_Data\\Log4Net.Logs\\backend.log" />
< lockingModel type =" log4net.Appender.FileAppender+MinimalLock " />
< appendToFile value =" true" />
< rollingStyle value =" Size" />
< maxSizeRollBackups value =" 10" />
< maximumFileSize value =" 3MB" />
< staticLogFileName value =" true" />
< layout type =" log4net.Layout.PatternLayout">
< param name =" ConversionPattern" value="%d [%t] %-5p %c %m%n" />
</ layout>
</ appender>