Example #1
0
        public void Log(PerformanceLogTick t)
        {
            if (t.Stopwatch != null)
            {
                t.Stopwatch.Stop();

                _loggingService.Information(
                    Pattern,
                    _applicationConfiguration.GetCurrentEnvironment().ToString(),
                    _applicationConfiguration.GetApplicationId() ?? "",
                    _applicationConfiguration.GetInstanceId() ?? "",
                    t.Action ?? "",
                    t.Url ?? "",
                    t.HttpResponse ?? "",
                    t.HttpResponseStatusCode ?? "",
                    t.Browser ?? "",
                    t.RequestJson,
                    t.ResponseJson,
                    t.Stopwatch.ElapsedMilliseconds,
                    t.CorrelationId,
                    t.Exception
                    );
            }
            else
            {
                _loggingService.Information(
                    Pattern,
                    _applicationConfiguration.GetCurrentEnvironment().ToString(),
                    _applicationConfiguration.GetApplicationId() ?? "",
                    _applicationConfiguration.GetInstanceId() ?? "",
                    t.Action ?? "",
                    t.Url ?? "",
                    t.HttpResponse ?? "",
                    t.HttpResponseStatusCode ?? "",
                    t.Browser ?? "",
                    t.RequestJson,
                    t.ResponseJson,
                    t.Miliseconds,
                    t.CorrelationId,
                    t.Exception
                    );
            }
        }