private void OnContextBeginRequest(object sender, EventArgs e)
        {
            if (!_init)
            {
                HttpContext context = ((HttpApplication)sender).Context;

                InitializeApplication(context);
            }

            if (_httpApplicationEvents != null)
            {
                _httpApplicationEvents.ContextBeginRequest(sender, e);
            }
        }
Exemple #2
0
        public void ContextBeginRequest(object sender, EventArgs e)
        {
            HttpContext context = ((HttpApplication)sender).Context;

            if (!_troubleshootingStoreListCreated)
            {
                SPSecurity.RunWithElevatedPrivileges(() => CreateTroubleshootingStoreServersList(_absoluteUri));
            }

            // Store the time of request beginning
            if (context != null && HttpContext.Current.Request.Path.EndsWith(".aspx", StringComparison.OrdinalIgnoreCase))
            {
                var    info        = new FileInfo(HttpContext.Current.Request.Path);
                string logFilename = String.Format("C:\\Logs\\Statistics {0:yyyy-MM-dd-hh-mm-fffffff}_", DateTime.Now) + info.Name;
                context.Items.Add(StatisticsSlotName, StatisticsTracer.NewStatisticsTracer("TranslatorModule", new FileLogStatisticsWriter(logFilename), _activateStatisticsLogDetails));
                //// context.Items.Add(StatisticsSlotName, StatisticsTracer.NewStatisticsTracer("TranslatorModule", new DebugStatisticsWriter(), _activateStatisticsLogDetails));
            }

            _httpApplicationEvents.ContextBeginRequest(sender, e);
        }