forked from Excel-DNA/Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.config
166 lines (144 loc) · 6.43 KB
/
App.config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--
This .config file contains the various configuration examples.
* log4net
* NLog
* ExplicitDefaults
* DisableLogging
* VerboseLogging
* FileLogging
-->
<!-- ============= Begin log4net ================ -->
<!--
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
</configSections>
<system.diagnostics>
<sources>
<source name="ExcelDna.Integration" switchValue="Verbose">
<listeners>
<remove name="Default" />
<add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Off"/>
</add>
<add name="Log4NetListener" type="Cavity.Diagnostics.Log4NetTraceListener,Logging" >
<filter type="System.Diagnostics.EventTypeFilter" initializeData="All"/>
</add>
</listeners>
</source>
</sources>
</system.diagnostics>
<log4net>
<appender name="DebugAppender" type="log4net.Appender.DebugAppender" >
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="LOG4NET: %date [%thread] %-5level %logger [%ndc] - %message%newline" />
</layout>
</appender>
<root>
<level value="INFO" />
<appender-ref ref="DebugAppender" />
</root>
</log4net>
-->
<!-- ============= End log4net ================ -->
<!-- ============= Begin NLog ================ -->
<!--
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog"/>
</configSections>
<system.diagnostics>
<sources>
<source name="ExcelDna.Integration" switchValue="Verbose">
<listeners>
<remove name="Default" />
<add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Off"/>
</add>
<add name="NLogListener" type="NLog.NLogTraceListener,NLog" >
<filter type="System.Diagnostics.EventTypeFilter" initializeData="All"/>
</add>
</listeners>
</source>
</sources>
</system.diagnostics>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="debugger" xsi:type="Debugger" layout="NLOG: ${longdate}|${level:uppercase=true}|${logger}[${event-properties:EventID}]|${message}"/>
</targets>
<rules>
<logger name="*" minlevel="Warn" writeTo="debugger" />
</rules>
</nlog>
-->
<!-- ============= End NLog ================ -->
<!-- ============= Start ExplicitDefaults ============ -->
<!--
This part of the sample has a configuration that is equivalent to the default configuration (when there are no entries in the .config file.
This is a good start for customization of the levels or adding trace listeners.
By default the TraceSource is configured to source only Warning, Error and Fatal.
the configuration can override this by setting switchValue attribute of the source tag (or create an explicit SourceSwitch).
switchValue is a SourceLevel: Off, Critical, Error, Warning (default), Information, Verbose, All
The DefaultTraceListener is automatically added to all TraceSources. It will write messages to the Debug output (if a debugger is attached to Excel).
The DefaultTraceListener can be removed with a <remove name="Default"> tag in the <listeners> subtree.
Excel-DNA adds the LogDisplayTraceListener to the TraceSource. By default, only Warning and Error messages are written to the LogDisplay,
and the LogDisplay window is only shown if at least one Error message is written.
The level of messages written to the LogDisplay can be adjusted by explicitly adding a "LogDisplay" listener of the relevant type,
and setting the listener's filter to an EventTypeFilter with the correct setting.
The EventTypeFiler's initializeData attribute is again a SourceLevel, i.e. one of: Off, Critical, Error, Warning (default), Information, Verbose, All.
We use this filter to disable the LogDisplay completely - just set the filter to initializeData="Off".
-->
<!--
<system.diagnostics>
<sources>
<source name="ExcelDna.Integration" switchValue="Warning">
<listeners>
<add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="All"/>
</add>
</listeners>
</source>
</sources>
</system.diagnostics>
-->
<!-- ============= End ExplicitDefaults ============ -->
<!-- ============== Start DisableLogging ============= -->
<!-- This sample configuration disables all logging -->
<!--
<system.diagnostics>
<sources>
<source name="ExcelDna.Integration" switchValue="Off">
</source>
</sources>
</system.diagnostics>
-->
<!-- ============== End DisableLogging ============= -->
<!-- ============== Start VerboseLogging ============= -->
<!-- This sample configuration disables all logging -->
<!--
<system.diagnostics>
<sources>
<source name="ExcelDna.Integration" switchValue="All">
</source>
</sources>
</system.diagnostics>
-->
<!-- ============== End VerboseLogging ============= -->
<!-- =============== Start FileLogging ============== -->
<!-- The initializeData attribute of the TextWriterTraceListener indicates the file path, either absolute or relative to the .xll.config file directory -->
<system.diagnostics>
<trace autoflush="false" indentsize="4"/>
<sources>
<source name="ExcelDna.Integration" switchValue="All">
<listeners>
<remove name="Default"/>
<add name="LogDisplay" type="ExcelDna.Logging.LogDisplayTraceListener,ExcelDna.Integration">
<filter type="System.Diagnostics.EventTypeFilter" initializeData="Off"/>
</add>
<add name="File" type="System.Diagnostics.TextWriterTraceListener" initializeData="TextWriterOutput.log" />
</listeners>
</source>
</sources>
</system.diagnostics>
<!-- =============== End FileLogging ============== -->
</configuration>