Wednesday, January 2, 2008

Log4Net Debugging Trace Troubleshooting

I couldn't have made it work without the trace. Make sure the following sections are in your Web.config. Then look for the log files in the application root. The directory should have 'write' permissions for ASP.NET user.

<?xml version="1.0"?>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>

<trace autoflush="true">
<add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="log4net_trace.txt" />

<add key="log4net.Internal.Debug" value="true"/>

<appender name="FileAppender" type="log4net.Appender.FileAppender">
<file value="log-file.txt" />
<appendToFile value="true" />

<level value="ALL"/>
<appender-ref ref="FileAppender"/>



No comments:

Check This Out!

More Links to Good Information