44 <!-- This .config file contains the various configuration examples.
55
66 log4net
7-
7+ NLog
88
99 -->
1010
1111 <!-- ============= Begin log4net ================ -->
1212
13+ <!--
1314 <configSections>
1415 <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
1516 </configSections>
1617 <system.diagnostics>
1718 <sources>
18- <!-- By default the TraceSource is configured to source only Warning, Error and Fatal.
19- the configuration can override this by setting switchValue, or create a SourceSwitch.
20- switchValue is a SourceLevel: Off, Critical, Error, Warning (default), Information, Verbose, All
21- By default, LogDisplay is only shown if Errors are present.
22- -->
2319 <source name="ExcelDna.Integration" switchValue="Verbose">
2420 <listeners>
2521 <remove name="Default" />
26- <!-- <clear/>-->
2722 <add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
28- <!-- EventTypeFilter takes a SourceLevel: Off, Critical, Error, Warning (default), Information, Verbose, All -->
29- <!-- We use the filter here to disable the LogDisplay -->
3023 <filter type="System.Diagnostics.EventTypeFilter" initializeData="Off"/>
3124 </add>
3225 <add name="Log4NetListener" type="Cavity.Diagnostics.Log4NetTraceListener,Logging" >
3629 </source>
3730 </sources>
3831 </system.diagnostics>
39- <appSettings >
40- <!-- Change this setting to "true" if you want to debug the log4net configuration -->
41- <add key =" log4net.Internal.Debug" value =" false" />
42- </appSettings >
4332 <log4net>
4433 <appender name="DebugAppender" type="log4net.Appender.DebugAppender" >
4534 <layout type="log4net.Layout.PatternLayout">
5140 <appender-ref ref="DebugAppender" />
5241 </root>
5342 </log4net>
54-
55- <!-- ============= End log4net ================ -->
43+ -->
5644
45+ <!-- ============= End log4net ================ -->
46+
47+ <!-- ============= Begin NLog ================ -->
48+
49+ <configSections >
50+ <section name =" nlog" type =" NLog.Config.ConfigSectionHandler, NLog" />
51+ </configSections >
52+ <system .diagnostics>
53+ <sources >
54+ <source name =" ExcelDna.Integration" switchValue =" Verbose" >
55+ <listeners >
56+ <remove name =" Default" />
57+ <add name =" LogDisplay" type =" ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration" >
58+ <filter type =" System.Diagnostics.EventTypeFilter" initializeData =" Off" />
59+ </add >
60+ <add name =" NLogListener" type =" NLog.NLogTraceListener,NLog" >
61+ <filter type =" System.Diagnostics.EventTypeFilter" initializeData =" All" />
62+ </add >
63+ </listeners >
64+ </source >
65+ </sources >
66+ </system .diagnostics>
67+ <nlog xmlns =" http://www.nlog-project.org/schemas/NLog.xsd" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" >
68+ <targets >
69+ <target name =" debugger" xsi : type =" Debugger" layout =" NLOG: ${longdate}|${level:uppercase=true}|${logger}[${event-properties:EventID}]|${message}" />
70+ </targets >
71+ <rules >
72+ <logger name =" *" minlevel =" Warn" writeTo =" debugger" />
73+ </rules >
74+ </nlog >
75+
76+ <!-- ============= End NLog ================ -->
5777</configuration >
0 commit comments