개정판 ce3f0d7a
issue #745: change logger with log4net
Change-Id: I1be08796d6f1a110b7ec3f94121a6bea96fc7b56
KCOM/App.xaml.cs | ||
---|---|---|
53 | 53 |
/// <summary> |
54 | 54 |
/// logger |
55 | 55 |
/// </summary> |
56 |
public static ILog log = null; |
|
56 |
public static ILog DBLogger = null; |
|
57 |
public static ILog FileLogger = null; |
|
57 | 58 |
|
58 | 59 |
/// <summary> |
59 | 60 |
/// Application Data Folder |
... | ... | |
95 | 96 |
} |
96 | 97 |
/// up to here |
97 | 98 |
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); |
98 |
log4net.GlobalContext.Properties["LogFilePath"] = Path.Combine(AppDataFolder, "log4net.db"); |
|
99 |
log = LogManager.GetLogger(typeof(App)); |
|
99 |
log4net.GlobalContext.Properties["LogDBFilePath"] = Path.Combine(AppDataFolder, "log4net.db"); |
|
100 |
log4net.GlobalContext.Properties["LogFilePath"] = Path.Combine(AppDataFolder, "Log", "log4net.log"); |
|
101 |
App.DBLogger = LogManager.GetLogger("DBLogger"); |
|
102 |
App.FileLogger = LogManager.GetLogger("EventLogger"); |
|
100 | 103 |
|
101 | 104 |
splash.Show(false, false); |
102 | 105 |
|
... | ... | |
252 | 255 |
{ |
253 | 256 |
try |
254 | 257 |
{ |
255 |
App.log.Fatal(e.ExceptionObject as Exception);
|
|
258 |
App.DBLogger.Fatal(e.ExceptionObject as Exception);
|
|
256 | 259 |
} |
257 | 260 |
catch (Exception ex) |
258 | 261 |
{ |
... | ... | |
289 | 292 |
|
290 | 293 |
private void ErrorLogFileWrite(string Err) |
291 | 294 |
{ |
295 |
App.FileLogger.Debug(Err); |
|
296 |
/* |
|
292 | 297 |
try |
293 | 298 |
{ |
294 | 299 |
string pathString = AppDataFolder + "\\Err"; |
... | ... | |
306 | 311 |
{ |
307 | 312 |
string strError = er.ToString(); |
308 | 313 |
} |
314 |
*/ |
|
309 | 315 |
} |
310 | 316 |
} |
311 | 317 |
} |
내보내기 Unified diff