Logging log4net

When logging doesn't work, you may need to log the log.

Basically, you have to add this to <appSettings>:

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

This should enable you to see some output on the console (or Visual Studio if you running an app from there). If this doesn't suit your needs, then writing to a file may be appropriate, by adding the following to the <system.diagnostics> section:

    <trace autoflush="true">
        <add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\log4net.txt" />

source: Stack Overflow and Apache log4net FAQ

No comments:

Post a Comment