There are 2 way of enabling internal debugging in log4net:
Specify the log4net.Internal.Debug option in the application's config file
This is the preferred method to enable internal debugging, add the log4net.Internal.Debug key to the app.config file of you application.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
</configuration>
Debug logging will start immediately when the application starts.
Enable log4net's internal debug programmatically
A second way is to do this programmatically. Set the log4net.Util.LogLog.InternalDebugging property to true:
log4net.Util.LogLog.InternalDebugging = true;
Internal debug log output
Internal debugging messages are written to the console and to the System.Diagnostics.Trace. When you have to console output you can redirect the System.Console.Out. Or you can redirect the trace message to a 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>