1+ <?xml version =" 1.0" encoding =" utf-8" ?>
2+ <configuration >
3+ <configSections >
4+ <section name =" loggingConfiguration"
5+ type =" Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
6+ requirePermission =" true" />
7+ <section name =" dataConfiguration"
8+ type =" Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
9+ requirePermission =" true" />
10+ </configSections >
11+ <!-- Flat File Trace Listener-->
12+
13+ <loggingConfiguration name =" Logging Application Block"
14+ tracingEnabled =" true"
15+ defaultCategory =" Default Category"
16+ logWarningsWhenNoCategoriesMatch =" true" >
17+ <formatters >
18+ <add name =" Text Formatter"
19+ template =" Timestamp: {timestamp}{newline}
 Message: {message}{newline}
 Category: {category}{newline}
 Machine: {localMachine}{newline}
 App Domain: {localAppDomain}{newline}"
20+ type =" Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
21+ />
22+ <add name =" One Line Formatter"
23+ template =" {timestamp(local)} Cat: {category} Pri: {priority} EId: {eventid} Sev: {severity} {message} Title:{title} Machine: {machine} Application Domain: {appDomain} Process Id: {processId} Process Name: {processName} Win32 Thread Id: {win32ThreadId} Thread Name: {threadName} Extended Properties: {dictionary({key} - {value})}"
24+ type =" Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
25+ />
26+ </formatters >
27+ <listeners >
28+ <!-- Trace Listener to log entry to the System Event log using the Text Formatter format from above -->
29+ <add name =" Formatted EventLog TraceListener"
30+ source =" Enterprise Library Logging"
31+ formatter =" Text Formatter"
32+ log =" Application"
33+ machineName =" "
34+ listenerDataType =" Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
35+ traceOutputOptions =" None"
36+ filter =" All"
37+ type =" Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
38+ />
39+ <!-- Trace Listener to log entry to a Rolling Text File log using the One Line Formatter format from above -->
40+ <add name =" Rolling Flat File"
41+ fileName =" Logger.log"
42+ formatter =" One Line Formatter"
43+ rollFileExistsBehavior =" Increment"
44+ rollInterval =" Midnight"
45+ rollSizeKB =" 10000"
46+ timeStampPattern =" yyyy-MM-dd"
47+ listenerDataType =" Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
48+ traceOutputOptions =" None"
49+ filter =" All"
50+ type =" Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
51+ />
52+ </listeners >
53+ <logFilters >
54+ <add name =" LogEnabled Filter"
55+ type =" Microsoft.Practices.EnterpriseLibrary.Logging.Filters.LogEnabledFilter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.505.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
56+ enabled =" true"
57+ />
58+ </logFilters >
59+ <categorySources >
60+ <!-- Log all Warnings to the System Event Log -->
61+ <add name =" Default Category"
62+ switchValue =" Warning" >
63+ <listeners >
64+ <add name =" Formatted EventLog TraceListener" />
65+ </listeners >
66+ </add >
67+ </categorySources >
68+ <specialSources >
69+ <!-- Log everyting not specified above to the Rolling Text File log -->
70+ <allEvents switchValue =" All" name =" All Events" >
71+ <listeners >
72+ <add name =" Rolling Flat File" />
73+ </listeners >
74+ </allEvents >
75+ <errors switchValue =" All" name =" Logging Errors & Warnings" >
76+ <listeners >
77+ <add name =" Formatted EventLog TraceListener" />
78+ </listeners >
79+ </errors >
80+ </specialSources >
81+ </loggingConfiguration >
82+ </configuration >
0 commit comments