Hello Gawel,
I, too, had a problem getting this working properly... This is what I ended
up doing...
1. Modify the web.config file by adding this configSection:
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,
log4net"/>
</configSections>
2. Then add this configuration section:
<log4net>
<root>
<level value="OFF" />
<appender-ref ref="FileAppender" />
</root>
<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="log-file.txt"/>
<appendToFile value="true"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d [%t] %-5p %c [%x] <%X{auth}> - %m%n" />
</layout>
</appender>
</log4net>
3. Now, the key part that put everything together... In Application_Start,
put this line:
log4net.Config.DOMConfigurator.Configure(); // this loads the config information
from the web.config file
4. Add logging to your classes, according to the samples at the log4net website.