예제 #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,
                               "{Type}{Message}{Layer}{Location}{Product}" +
                               "{Environment}{ElapsedMilliseconds}{Exception}{Hostname}" +
                               "{UserId}{UserName}{CorrelationId}{AdditionalInfo}",
                               "error", infoToLog.Message,
                               infoToLog.Layer, infoToLog.Location,
                               infoToLog.Product,
                               infoToLog.Environment, infoToLog.ElapsedMilliseconds, infoToLog.Exception?.ToBetterString(),
                               infoToLog.Hostname, infoToLog.UserId,
                               infoToLog.UserName, infoToLog.CorrelationId,
                               infoToLog.AdditionalInfo
                               );
        }
예제 #2
0
 public static void WriteError(LogDetail infoToLog)
 {
     _errorLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog);
     _errorLogger.Information(Environment.NewLine);
 }
예제 #3
0
 public static void WriteUsage(LogDetail infoToLog)
 {
     _usageLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog);
 }
예제 #4
0
 public static void WritePerf(LogDetail infoToLog)
 {
     _perfLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog);
 }