File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed
Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<configuration >
3+ <configSections >
4+ <section name =" log4net" type =" log4net.Config.Log4NetConfigurationSectionHandler, log4net" />
5+ </configSections >
36 <system .diagnostics>
47 <trace autoflush =" true" indentsize =" 0" >
58 <listeners >
69 <add name =" SysInternalsListener" type =" Sysinternals.Debug.ProcessMonitorTraceListener, Sysinternals.Debug" />
710 </listeners >
811 </trace >
912 </system .diagnostics>
10- <startup >
11-
12- <supportedRuntime version =" v2.0.50727" /></startup >
13+ <log4net >
14+ <appender name =" ProcMon" type =" Sysinternals.log4net.ProcMonAppender, Sysinternals.log4net" >
15+ <layout type =" log4net.Layout.PatternLayout" >
16+ <conversionPattern value =" %-5level %message" />
17+ </layout >
18+ </appender >
19+
20+ <root >
21+ <level value =" DEBUG" />
22+ <appender-ref ref =" ProcMon" />
23+ </root >
24+ </log4net >
25+
1326</configuration >
Original file line number Diff line number Diff line change @@ -16,12 +16,13 @@ class Program
1616 {
1717 static void Main ( string [ ] args )
1818 {
19+ /*
1920 Hierarchy hierarchy = (Hierarchy)LogManager.GetRepository();
2021 hierarchy.Root.AddAppender(new ColoredConsoleAppender());
2122 hierarchy.Root.AddAppender(new ProcMonAppender());
2223 hierarchy.Root.Level = Level.Debug;
2324 hierarchy.Configured = true;
24-
25+ */
2526 ILog _logger = LogManager . GetLogger ( MethodBase . GetCurrentMethod ( ) . DeclaringType ) ;
2627 Debug . Listeners . Remove ( "Default" ) ;
2728
Original file line number Diff line number Diff line change 55// General Information about an assembly is controlled through the following
66// set of attributes. Change these attribute values to modify the information
77// associated with an assembly.
8+ using log4net . Config ;
9+
810[ assembly: AssemblyTitle ( "ManagedTest" ) ]
911[ assembly: AssemblyDescription ( "" ) ]
1012[ assembly: AssemblyConfiguration ( "" ) ]
3436// [assembly: AssemblyVersion("1.0.*")]
3537[ assembly: AssemblyVersion ( "1.0.0.0" ) ]
3638[ assembly: AssemblyFileVersion ( "1.0.0.0" ) ]
39+
40+ // Read the log4net config from the app.config
41+ [ assembly: XmlConfigurator ( Watch = false ) ]
You can’t perform that action at this time.
0 commit comments