public static void InitLogger(String confFile) { if (!File.Exists(confFile)) { InternalLogManager.InitializeConsoleLogger(LogLevel.LOG_LEVEL_INFO); initialized = true; useLog4Net = false; return; } XmlDocument doc = new XmlDocument(); try { doc.Load(confFile); XmlNode n = doc.SelectSingleNode("log4net"); doc = null; if (n == null) { InternalLogManager.InitializeLogger(confFile); useLog4Net = false; } else { // Config log4net log4net.Config.XmlConfigurator.Configure(LogManager.GetRepository(Assembly.GetEntryAssembly()), new FileInfo(confFile)); useLog4Net = true; } initialized = true; } catch (Exception e) { Console.Error.WriteLine("Cannot configure logger: " + e.Message); initialized = false; } }
public void Fatal(string message, Exception innerException) { InternalLogManager.Log(LogLevel.LOG_LEVEL_CRITICAL, name, message + " Exception: " + innerException.Message + " - StackTrace: " + innerException.StackTrace); }
public void Error(string message, Exception innerException) { InternalLogManager.Log(LogLevel.LOG_LEVEL_ERROR, name, message + " Exception: " + innerException.Message + " - StackTrace: " + innerException.StackTrace); }
public bool IsDebug() { return(InternalLogManager.IsDebug()); }
public void Fatal(string message) { InternalLogManager.Log(LogLevel.LOG_LEVEL_CRITICAL, name, message); }
public void Error(string message) { InternalLogManager.Log(LogLevel.LOG_LEVEL_ERROR, name, message); }
public void Info(string message) { InternalLogManager.Log(LogLevel.LOG_LEVEL_INFO, name, message); }
public void Warn(string message) { InternalLogManager.Log(LogLevel.LOG_LEVEL_WARN, name, message); }
public void Debug(string message) { InternalLogManager.Log(LogLevel.LOG_LEVEL_DEBUG, name, message); }
public static void InitEventLogger(int level, String section, String key) { InternalLogManager.InitializeEventLogger(level, section, key); initialized = true; }