123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- using System;
- namespace WWPipeLine.Commons
- {
- internal class Log4Loggerbak : ILogger
- {
- private static log4net.ILog log = log4net.LogManager.GetLogger("Log");
- private static log4net.ILog logError = log4net.LogManager.GetLogger("LogError");
- public Log4Loggerbak()
- {
- log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(Paths.ApplicationConfigDir + "/log4net.xml"));
- }
- public void Trace(string message)
- {
- Debug(message);
- }
- public void Debug(string message)
- {
- try
- {
- if (log.IsDebugEnabled)
- {
- log.Debug(message);
- }
- }
- catch
- {
- }
- }
- public void Info(string message)
- {
- try
- {
- if (log.IsInfoEnabled)
- {
- log.Info(message);
- }
- }
- catch
- {
- }
- }
- public void Warn(string message)
- {
- try
- {
- if (log.IsWarnEnabled)
- {
- log.Warn(message);
- }
- }
- catch
- {
- }
- }
- public void Shutdown()
- {
- log4net.LogManager.Shutdown();
- }
- public void Error(Exception ex)
- {
- try
- {
- if (logError.IsErrorEnabled)
- {
- logError.Error(ex);
- }
- }
- catch
- {
- }
- }
- public void Error(string message)
- {
- try
- {
- if (logError.IsErrorEnabled)
- {
- logError.Error(message);
- }
- }
- catch
- {
- }
- }
- public void Fatal(Exception ex)
- {
- try
- {
- if (logError.IsFatalEnabled)
- {
- logError.Fatal(ex);
- }
- }
- catch
- {
- }
- }
- public void Fatal(string message)
- {
- try
- {
- if (logError.IsFatalEnabled)
- {
- logError.Fatal(message);
- }
- }
- catch
- {
- }
- }
-
-
- }
- }
|