11<?xml version =" 1.0" encoding =" utf-8" ?>
22<configuration >
33
4- <!-- This .config file contains the various configuration examples.
4+ <!--
5+ This .config file contains the various configuration examples.
56
6- log4net
7- NLog
7+ * log4net
8+ * NLog
9+ * ExplicitDefaults
10+ * DisableLogging
11+ * VerboseLogging
12+ * FileLogging
813
914 -->
1015
4651
4752 <!-- ============= Begin NLog ================ -->
4853
54+ <!--
4955 <configSections>
5056 <section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
5157 </configSections>
7278 <logger name="*" minlevel="Warn" writeTo="debugger" />
7379 </rules>
7480 </nlog>
81+ -->
7582
7683 <!-- ============= End NLog ================ -->
84+
85+ <!-- ============= Start ExplicitDefaults ============ -->
86+ <!--
87+ This part of the sample has a configuration that is equivalent to the default configuration (when there are no entries in the .config file.
88+ This is a good start for customization of the levels or adding trace listeners.
89+
90+ By default the TraceSource is configured to source only Warning, Error and Fatal.
91+ the configuration can override this by setting switchValue attribute of the source tag (or create an explicit SourceSwitch).
92+ switchValue is a SourceLevel: Off, Critical, Error, Warning (default), Information, Verbose, All
93+ The DefaultTraceListener is automatically added to all TraceSources. It will write messages to the Debug output (if a debugger is attached to Excel).
94+ The DefaultTraceListener can be removed with a <remove name="Default"> tag in the <listeners> subtree.
95+ Excel-DNA adds the LogDisplayTraceListener to the TraceSource. By default, only Warning and Error messages are written to the LogDisplay,
96+ and the LogDisplay window is only shown if at least one Error message is written.
97+ The level of messages written to the LogDisplay can be adjusted by explicitly adding a "LogDisplay" listener of the relevant type,
98+ and setting the listener's filter to an EventTypeFilter with the correct setting.
99+ The EventTypeFiler's initializeData attribute is again a SourceLevel, i.e. one of: Off, Critical, Error, Warning (default), Information, Verbose, All.
100+ We use this filter to disable the LogDisplay completely - just set the filter to initializeData="Off".
101+ -->
102+
103+ <!--
104+ <system.diagnostics>
105+ <sources>
106+ <source name="ExcelDna.Integration" switchValue="Warning">
107+ <listeners>
108+ <add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
109+ <filter type="System.Diagnostics.EventTypeFilter" initializeData="All"/>
110+ </add>
111+ </listeners>
112+ </source>
113+ </sources>
114+ </system.diagnostics>
115+ -->
116+
117+ <!-- ============= End ExplicitDefaults ============ -->
118+
119+ <!-- ============== Start DisableLogging ============= -->
120+ <!-- This sample configuration disables all logging -->
121+
122+ <!--
123+ <system.diagnostics>
124+ <sources>
125+ <source name="ExcelDna.Integration" switchValue="Off">
126+ </source>
127+ </sources>
128+ </system.diagnostics>
129+ -->
130+
131+ <!-- ============== End DisableLogging ============= -->
132+
133+ <!-- ============== Start VerboseLogging ============= -->
134+ <!-- This sample configuration disables all logging -->
135+
136+ <!--
137+ <system.diagnostics>
138+ <sources>
139+ <source name="ExcelDna.Integration" switchValue="All">
140+ </source>
141+ </sources>
142+ </system.diagnostics>
143+ -->
144+ <!-- ============== End VerboseLogging ============= -->
145+
146+ <!-- =============== Start FileLogging ============== -->
147+ <!-- The initializeData attribute of the TextWriterTraceListener indicates the file path, either absolute or relative to the .xll.config file directory -->
148+
149+ <system .diagnostics>
150+ <trace autoflush =" false" indentsize =" 4" />
151+ <sources >
152+ <source name =" ExcelDna.Integration" switchValue =" All" >
153+ <listeners >
154+ <remove name =" Default" />
155+ <add name =" LogDisplay" type =" ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration" >
156+ <filter type =" System.Diagnostics.EventTypeFilter" initializeData =" Off" />
157+ </add >
158+ <add name =" File" type =" System.Diagnostics.TextWriterTraceListener" initializeData =" TextWriterOutput.log" />
159+ </listeners >
160+ </source >
161+ </sources >
162+ </system .diagnostics>
163+
164+ <!-- =============== End FileLogging ============== -->
165+
77166</configuration >
0 commit comments