static void Main(string[] args) { var detail = GetLogDetail("Starting Performance ", null); _perfTracker = new PerfTracker("SLoggerConsole_Execution", null, detail.UserName, detail.Location, detail.Product, detail.Layer); // create perf logger SLogger.WritePerformance(detail); SLogger.WriteDiagnostics(detail); SLogger.WriteUsage(detail); try { var ex = new Exception("Something bad happened."); ex.Data.Add("input param", "nothing to see here"); throw ex; } catch (Exception ex) { SLogger.WriteError(GetLogDetail("", ex)); } _perfTracker.Stop(); }
public static void LogNetCoreError(string product, string layer, string activity, Exception exception, HttpContext context, Dictionary <string, object> additionalInfo = null) { var logDetail = GetSLogDetail(product, layer, activity, context, additionalInfo); logDetail.Exception = exception; SLogger.WriteDiagnostics(logDetail); }
public static void LogNetCoreDiagnostics(string product, string layer, string activity, string message, HttpContext context, Dictionary <string, object> additionalInfo = null) { var logDetail = GetSLogDetail(product, layer, activity, context, additionalInfo); logDetail.Message = message; SLogger.WriteDiagnostics(logDetail); }