Revision cfed7823 trunk/Pithos.Client.WPF/AppBootstrapper.cs
b/trunk/Pithos.Client.WPF/AppBootstrapper.cs | ||
---|---|---|
1 | 1 |
using System.Windows; |
2 | 2 |
using System.Windows.Navigation; |
3 |
using Caliburn.Micro; |
|
3 | 4 |
using Caliburn.Micro.Logging; |
5 |
using Pithos.Client.WPF.Caliburn.Micro.Logging; |
|
4 | 6 |
using Pithos.Core; |
5 | 7 |
using Pithos.Network; |
8 |
using log4net.Appender; |
|
9 |
using log4net.Config; |
|
10 |
using log4net.Filter; |
|
11 |
using log4net.Layout; |
|
6 | 12 |
|
7 | 13 |
namespace Pithos.Client.WPF |
8 | 14 |
{ |
... | ... | |
20 | 26 |
|
21 | 27 |
public AppBootstrapper() |
22 | 28 |
{ |
23 |
LogManager.GetLog = type => new DebugLogger(type); |
|
29 |
ConfigureLogging(); |
|
30 |
|
|
31 |
LogManager.GetLog = type => new log4netLogger(type); |
|
24 | 32 |
} |
25 | 33 |
|
34 |
private static void ConfigureLogging() |
|
35 |
{ |
|
36 |
var patternLayout = new PatternLayout(); |
|
37 |
patternLayout.ConversionPattern = "%logger (%property{myContext}) [%level]- %message%newline"; |
|
38 |
patternLayout.ActivateOptions(); |
|
39 |
var appender = new TraceAppender { Layout = patternLayout }; |
|
40 |
appender.AddFilter(new LevelRangeFilter{LevelMin=log4net.Core.Level.Info,LevelMax=log4net.Core.Level.Fatal}); |
|
41 |
appender.ActivateOptions(); |
|
42 |
|
|
43 |
BasicConfigurator.Configure(appender); |
|
44 |
} |
|
45 |
|
|
26 | 46 |
/// <summary> |
27 | 47 |
/// By default, we are configured to use MEF |
28 | 48 |
/// </summary> |
Also available in: Unified diff