Skip to content

Instantly share code, notes, and snippets.

@orjan
Created August 16, 2011 13:39
Show Gist options
  • Save orjan/1149086 to your computer and use it in GitHub Desktop.
Save orjan/1149086 to your computer and use it in GitHub Desktop.
Log4net configuration
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net" />
</configSections>
<log4net>
<appender name="OutputDebug" type="log4net.Appender.OutputDebugStringAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<conversionPattern value="%d [%t] %-5p %c - %m%n"/>
</layout>
</appender>
<root>
<level value="All" />
<appender-ref ref="OutputDebug" />
</root>
</log4net>
log4net.Config.XmlConfigurator.Configure();
private static readonly ILog log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment