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 ); }
public static void WriteError(LogDetail infoToLog) { _errorLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog); _errorLogger.Information(Environment.NewLine); }
public static void WriteUsage(LogDetail infoToLog) { _usageLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog); }
public static void WritePerf(LogDetail infoToLog) { _perfLogger.Write(LogEventLevel.Information, "{@LogDetail}", infoToLog); }