<system.diagnostics> <trace autoflush="true"> <listeners> <add name="textWriterTraceListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="%TEMP%\log.txt" /> </listeners> </trace> </system.diagnostics> <appSettings> <add key="log4net.Internal.Debug" value="true"/> </appSettings>
<configSections> <sectionGroup name="common"> <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> </sectionGroup> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> <!-- ... --> </configSection> <!-- ... --> <common> <logging> <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net1211"> choices are INLINE, FILE, FILE-WATCH, EXTERNAL otherwise BasicConfigurer.Configure is used log4net configuration file is specified with key configFile <arg key="configType" value="FILE-WATCH" /> <arg key="configFile" value="~/Config/log4net.config"/> <arg key="level" value="INFO" /> </factoryAdapter> </logging> </common> <!-- ... -->
static void Main() { AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionTrapper; // ...}