예제 #1
0
        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();
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }