public static void WriteError(HylogDetails 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, "{@FlogDetail}", infoToLog); }
public static void WriteDiagonistic(HylogDetails infoToLog) { var writeDiagnostics = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableDiagnostics"]); if (!writeDiagnostics) { return; } _diagnosticLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog); }
public PerfTracker(string name, string userId, string userName, string location, string product, string layer) { _sw = Stopwatch.StartNew(); _infoToLog = new HylogDetails() { Message = name, 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(HylogDetails infoToLog) { _usageLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog); }
public static void WritePerf(HylogDetails infoToLog) { _perfLogger.Write(LogEventLevel.Information, "{@FlogDetail}", infoToLog); }