Пример #1
0
        public static void LogResponse(GlsLoggerContext context, GLSLogger.StatusCode statusCode, ResponseBase response, GlsRawResponse rawResponse)
        {
            int    num = Environment.TickCount - context.TickStart;
            string resultCode;

            switch (statusCode)
            {
            case GLSLogger.StatusCode.Found:
                resultCode = "Found";
                break;

            case GLSLogger.StatusCode.NotFound:
                resultCode = "NotFound";
                break;

            case GLSLogger.StatusCode.WriteSuccess:
                resultCode = "Success";
                break;

            default:
                throw new ArgumentException("statusCode");
            }
            GLSLogger.BeginAppend(context.MethodName, context.ParameterValue, context.ResolveEndpointToIpAddress(false), resultCode, rawResponse, (long)num, string.Empty, response.TransactionID, context.ConnectionId, response.Diagnostics);
            ADProviderPerf.UpdateGlsCallLatency(context.MethodName, context.IsRead, num, true);
        }
Пример #2
0
        public static void LogException(GlsLoggerContext context, Exception ex)
        {
            int        num        = Environment.TickCount - context.TickStart;
            StackTrace stackTrace = new StackTrace(false);

            GLSLogger.BeginAppend(context.MethodName, context.ParameterValue, context.ResolveEndpointToIpAddress(true), "Exception", null, (long)num, ex.Message + stackTrace.ToString(), context.RequestTrackingGuid.ToString(), context.ConnectionId, string.Empty);
            ADProviderPerf.UpdateGlsCallLatency(context.MethodName, context.IsRead, num, false);
        }