Ejemplo n.º 1
0
        // Token: 0x06002543 RID: 9539 RVA: 0x000869C8 File Offset: 0x00084BC8
        internal static void LogHttpContextData(HttpContext httpContext, RequestDetailsLogger logger)
        {
            if (OwaServerLogger.instance == null || !OwaServerLogger.instance.Configuration.IsLoggingEnabled)
            {
                return;
            }
            if (logger.Get(ExtensibleLoggerMetadata.EventId) == null)
            {
                if (!logger.ActivityScope.Statistics.Any <KeyValuePair <OperationKey, OperationStatistics> >())
                {
                    return;
                }
                OwaServerLogger.SetEventId(httpContext, logger);
            }
            logger.Set(OwaServerLogger.LoggerData.ContentLength, httpContext.Request.ContentLength);
            logger.Set(ServiceLatencyMetadata.HttpPipelineLatency, httpContext.Items[ServiceLatencyMetadata.HttpPipelineLatency]);
            NameValueCollection headers = httpContext.Request.Headers;
            string value = headers["X-OWA-ActionId"];

            if (!string.IsNullOrEmpty(value))
            {
                logger.Set(OwaServerLogger.LoggerData.ClientActionId, value);
            }
            string value2 = headers["X-OWA-ActionName"];

            if (!string.IsNullOrEmpty(value2))
            {
                logger.Set(OwaServerLogger.LoggerData.ClientActionName, value2);
            }
            string value3 = headers["X-EXT-ClientName"];

            if (!string.IsNullOrEmpty(value3))
            {
                logger.Set(OwaServerLogger.LoggerData.ExternalClientName, value3);
            }
            string value4 = headers["X-EXT-CorrelationId"];

            if (!string.IsNullOrEmpty(value4))
            {
                logger.Set(OwaServerLogger.LoggerData.ExternalCorrelationId, value4);
            }
            string sourceCafeServer = CafeHelper.GetSourceCafeServer(httpContext.Request);

            if (!string.IsNullOrEmpty(sourceCafeServer))
            {
                logger.Set(OwaServerLogger.LoggerData.FrontEndServer, sourceCafeServer);
            }
            string value5 = headers["X-OWA-OfflineRejectCode"];

            if (!string.IsNullOrEmpty(value5))
            {
                logger.Set(OwaServerLogger.LoggerData.OfflineRejectCode, value5);
            }
            string text = headers["logonLatency"];
            bool   flag = UserContextUtilities.IsDifferentMailbox(httpContext);

            if (!string.IsNullOrEmpty(text) || flag)
            {
                IMailboxContext mailboxContext = UserContextManager.GetMailboxContext(httpContext, null, false);
                if (!string.IsNullOrEmpty(text))
                {
                    logger.Set(OwaServerLogger.LoggerData.LogonLatencyName, text);
                    string userContext = string.Empty;
                    if (mailboxContext != null)
                    {
                        userContext = mailboxContext.Key.UserContextId.ToString(CultureInfo.InvariantCulture);
                    }
                    string[] keys = new string[]
                    {
                        "LGN.L"
                    };
                    string[] values = new string[]
                    {
                        text
                    };
                    Datapoint      datapoint = new Datapoint(DatapointConsumer.Analytics, "LogonLatency", DateTime.UtcNow.ToString("o"), keys, values);
                    ClientLogEvent logEvent  = new ClientLogEvent(datapoint, userContext);
                    OwaClientLogger.AppendToLog(logEvent);
                }
                if (flag && mailboxContext is SharedContext && httpContext.Items.Contains("CallContext"))
                {
                    CallContext callContext = httpContext.Items["CallContext"] as CallContext;
                    logger.Set(OwaServerLogger.LoggerData.User, callContext.GetEffectiveAccessingSmtpAddress());
                }
            }
            string value6 = httpContext.Items["BackEndAuthenticator"] as string;

            if (!string.IsNullOrEmpty(value6))
            {
                logger.Set(OwaServerLogger.LoggerData.BackendAuthenticator, value6);
            }
            object obj = httpContext.Items["TotalBERehydrationModuleLatency"];

            if (obj != null)
            {
                logger.Set(OwaServerLogger.LoggerData.RehydrationModuleLatency, obj);
            }
            string value7 = headers["X-OWA-Test-PassThruProxy"];

            if (!string.IsNullOrEmpty(value7))
            {
                logger.Set(OwaServerLogger.LoggerData.PassThroughProxy, value7);
            }
            string value8 = headers["X-SuiteServiceProxyOrigin"];

            if (!string.IsNullOrEmpty(value8))
            {
                logger.Set(OwaServerLogger.LoggerData.SuiteServiceProxyOrigin, value8);
            }
            HttpCookie httpCookie = httpContext.Request.Cookies["ClientId"];

            if (httpCookie != null)
            {
                logger.Set(OwaServerLogger.LoggerData.ClientId, httpCookie.Value);
            }
        }