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(); }
static void Main(string[] args) { var logDetails = GetSLogDetails("Starting Application", null); SLogger.WriteDiagnostic(logDetails); try { var ex = new Exception("Something bad has happend!"); ex.Data.Add("input param", "nothing to see here"); throw ex; } catch (Exception ex) { logDetails = GetSLogDetails("", ex); SLogger.WriteError(logDetails); } logDetails = GetSLogDetails("Used SLogging.Console application", null); SLogger.WriteUsage(logDetails); logDetails = GetSLogDetails("Stoping Application", null); SLogger.WriteDiagnostic(logDetails); }
public static void LogNetCoreUsage(string product, string layer, string activity, HttpContext context, Dictionary <string, object> additionalInfo = null) { SLogger.WriteUsage(GetSLogDetail(product, layer, activity, context, additionalInfo)); }