Monday, 2 March 2009

Debugging web apps with Visual Studio and logging with log4net

If like myself you use log4net and develop in Visual Studio, you may want to see what is being logged without having to leave the comfort of the IDE and look at a text file.

To get your logged output to appear in the output window of visual studio add this appender to your log4net configuration:

<appender name="ASPNETDebugger" type="log4net.Appender.TraceAppender">
    <layout type="log4net.Layout.SimpleLayout" />
</appender>

I've often found that I forget this little snippet of code but find it very useful when debugging a web app.

Submit this story to DotNetKicks Shout it

No comments:

Post a Comment