I'm trying to redirect all log messages from System.Diagnostics.Trace
to Common.Logging
as documented on the Common.Logging website.
Unfortunately when I run my application I get a StackOverflowException
and I'm not sure why. If I delete the <system.diagnostics>
section it runs fine.
I've replicated this problem using a simple Console application which makes a single call to Trace.WriteLine("hello");
Here's my complete App.config
file:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.diagnostics>
<trace>
<listeners>
<clear />
<add name="commonLoggingListener"
type="Common.Logging.Simple.CommonLoggingTraceListener, Common.Logging"
initializeData="LogLevel=Trace" />
</listeners>
</trace>
</system.diagnostics>
</configuration>
Can anyone make any suggestions as to what is causing the StackOverflowException
?