Example #1
0
 public static void WriteError(LogDetail infoToLog)
 {
     if (infoToLog.Exception != null)
     {
         var procName = FindProcName(infoToLog.Exception);
         infoToLog.Location = string.IsNullOrEmpty(procName) ? infoToLog.Location : procName;
         infoToLog.Message  = GetMessageFromException(infoToLog.Exception);
     }
     _errorLogger.Write(LogEventLevel.Error, "{@LogDetail}", infoToLog);
     //_errorLogger.Write(LogEventLevel.Information,
     //    "{Timestamp}{Message}{Layer}{Location}{Product}" +
     //    "{CustomException}{ElapsedMilliseconds}{Exception}{Hostname}" +
     //    "{UserId}{UserName}{CorrelationId}{AdditionalInfo}",
     //    infoToLog.Timestamp, infoToLog.Message,
     //    infoToLog.Layer, infoToLog.Location,
     //    infoToLog.Product, infoToLog.CustomException,
     //    infoToLog.ElapsedMilliseconds, infoToLog.Exception?.ToBetterString(),
     //    infoToLog.Hostname, infoToLog.UserId,
     //    infoToLog.UserName, infoToLog.CorrelationId,
     //    infoToLog.AdditionalInfo
     //);
 }
Example #2
0
 public static void WriteUsage(LogDetail infoToLog)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog);
 }
Example #3
0
 public static void WritePerf(LogDetail infoToLog)
 {
     _perfLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog);
 }