public static void WriteDiagnostic(FlogInfo infoToLog) { var writeDiagnostics = Convert.ToBoolean(ConfigurationManager.AppSettings["EnableDiagnostics"]); if (!writeDiagnostics) { return; } _diagnosticLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog); }
public PerfTracker(string name, string userId, string userName, string location, string product, string layer) { _sw = Stopwatch.StartNew(); _infoToLog = new FlogInfo() { Message = name, UserId = userId, UserName = userName, Product = product, Layer = layer, Location = location, Hostname = Environment.MachineName }; _beginTime = DateTime.Now; _details = new Dictionary <string, object>(); }
public static void WriteError(FlogInfo infoToLog) { infoToLog.Message = GetMessageFromException(infoToLog.Exception); _errorLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog); }
public static void WriteUsage(FlogInfo infoToLog) { _usageLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog); }
public static void WritePerf(FlogInfo infoToLog) { _perfLogger.Write(LogEventLevel.Information, "{@FlogInfo}", infoToLog); }