public static void WriteDiagnostic(AcmLoggingDetail infoToLog) { var writeDiagnostics = true; if (!writeDiagnostics) { return; } _diagnosticLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog); }
public static void WriteError(AcmLoggingDetail 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.Information, "{@AcmLoggingDetail}", infoToLog); }
public PerformanceTracker(string message, string userId, string userName, string location, string product, string layer) { _stopwatch = Stopwatch.StartNew(); _infoToLog = new AcmLoggingDetail() { Message = message, UserId = userId, UserName = userName, Product = product, Layer = layer, Location = location, Hostname = Environment.MachineName }; var beginTime = DateTime.Now; _infoToLog.AdditionalInfo = new Dictionary <string, object>() { { "Started", beginTime.ToString(CultureInfo.InvariantCulture) } }; }
public static void WriteUsage(AcmLoggingDetail infoToLog) { _usageLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog); }
public static void WritePerformance(AcmLoggingDetail infoToLog) { _performanceLogger.Write(LogEventLevel.Information, "{@AcmLoggingDetail}", infoToLog); }