Ejemplo n.º 1
0
 private static void LogHandler(object sender, LogEventArgs e)
 {
     switch (e.Level)
     {
         case LogLevel.Debug:
             string message = e.Source  + ":" + e.Member + " - " + e.Message;
             logger.Debug(message,e.Exception);
             break;
         case LogLevel.Info:
             logger.Info(e.Message);
             break;
         case LogLevel.Error:
             logger.Error(e.Message,e.Exception);
             break;
         case LogLevel.Warn:
             logger.Warn(e.Message,e.Exception);
             break;
     }
 }
Ejemplo n.º 2
0
 private void LogHandler(object sender, LogEventArgs e)
 {
     // Create a logger for use in this class
     ILog logger = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
     switch (e.Level)
     {
         case LogLevel.Debug:
             string message = e.Source  + ":" + e.Member + " - " + e.Message;
             logger.Debug(message,e.Exception);
             break;
         case LogLevel.Info:
             logger.Info(e.Message);
             break;
         case LogLevel.Error:
             logger.Error(e.Message,e.Exception);
             break;
         case LogLevel.Warn:
             logger.Warn(e.Message, e.Exception);
             break;
     }
 }