public static void WriteLog(LogLevelL4N logLevel, String log) { if (logLevel.Equals(LogLevelL4N.DEBUG)) { logger.Debug(log); } else if (logLevel.Equals(LogLevelL4N.ERROR)) { logger.Error(log); } else if (logLevel.Equals(LogLevelL4N.FATAL)) { logger.Fatal(log); } else if (logLevel.Equals(LogLevelL4N.INFO)) { logger.Info(log); } else if (logLevel.Equals(LogLevelL4N.WARN)) { logger.Warn(log); } }
public static void Write(Object Message, LogLevelL4N Level = LogLevelL4N.DEBUG) { try { if (Level.Equals(LogLevelL4N.DEBUG)) { _Logger.Debug(Message.ToString()); } else if (Level.Equals(LogLevelL4N.ERROR)) { _Logger.Error(Message.ToString()); } else if (Level.Equals(LogLevelL4N.FATAL)) { _Logger.Fatal(Message.ToString()); } else if (Level.Equals(LogLevelL4N.INFO)) { _Logger.Info(Message.ToString()); } else if (Level.Equals(LogLevelL4N.WARN)) { _Logger.Warn(Message.ToString()); } } catch { } }
/// <summary> /// /// </summary> /// <param name="logLevel"></param> /// <param name="log"></param> public static void WriteLog(LogLevelL4N logLevel, String log) { if (logLevel.Equals(LogLevelL4N.DEBUG)) { logger.Debug(log); } else if (logLevel.Equals(LogLevelL4N.ERROR)) { logger.Error(log); } else if (logLevel.Equals(LogLevelL4N.FATAL)) { logger.Fatal(log); } else if (logLevel.Equals(LogLevelL4N.INFO)) { logger.Info(log); } else if (logLevel.Equals(LogLevelL4N.WARN)) { logger.Warn(log); } }
/// <summary> /// It resolves module name and writes log in the file /// </summary> /// <param name="logLevel"></param> /// <param name="log"></param> public static void WriteLog(LogLevelL4N logLevel, String log) { string methodName = new System.Diagnostics.StackFrame(1, true).GetMethod().Name; string moduleName = new System.Diagnostics.StackFrame(1, true).GetMethod().ReflectedType.FullName; logger = LogManager.GetLogger(moduleName); if (logLevel.Equals(LogLevelL4N.DEBUG)) { logger.Debug(" " + methodName + ": " + log); } else if (logLevel.Equals(LogLevelL4N.ERROR)) { logger.Error(" " + methodName + ": " + log); } else if (logLevel.Equals(LogLevelL4N.FATAL)) { logger.Fatal(" " + methodName + ": " + log); } else if (logLevel.Equals(LogLevelL4N.INFO)) { logger.Info(" " + methodName + ": " + log); } else if (logLevel.Equals(LogLevelL4N.WARN)) { logger.Warn(" " + methodName + ": " + log); } }
public static void Log(ILog ilog, LogLevelL4N level, Exception Ex) { try { logger = ilog; exception = Ex; logLevel = level; Job job = new Job(string.Format(CONST_STRINGLOGIDFORMAT, DateTime.Now.ToString(CONST_STRINGDATEFORMAT))); job.Run.Once(); scheduler.SubmitJob(job, WriteLogFull); } catch { } }
public static void Log(ILog ilog, LogLevelL4N level, string message) { try { logger = ilog; Message = message; logLevel = level; Job job = new Job(string.Format(CONST_STRINGLOGIDFORMAT, DateTime.Now.ToString(CONST_STRINGDATEFORMAT))); job.Run.Once(); scheduler.SubmitJob(job, WriteLog); } catch { } }
/// <summary> /// /// </summary> /// <param name="logLevel"></param> /// <param name="log"></param> /// <param name="tStartTime"></param> public static void WriteLog(LogLevelL4N logLevel, String log, DateTime tStartTime) { var elapsed = DateTime.Now - tStartTime; WriteLog(logLevel, log + " - Execution time: " + elapsed.TotalSeconds.ToString("#0.0###") + " sec(s)"); }
internal static void Write(String Message, LogLevelL4N Level = LogLevelL4N.DEBUG) { if (Level.Equals(LogLevelL4N.DEBUG)) _Logger.Debug(Message); else if (Level.Equals(LogLevelL4N.ERROR)) _Logger.Error(Message); else if (Level.Equals(LogLevelL4N.FATAL)) _Logger.Fatal(Message); else if (Level.Equals(LogLevelL4N.INFO)) _Logger.Info(Message); else if (Level.Equals(LogLevelL4N.WARN)) _Logger.Warn(Message); }