Sage.Project.Application_EndRequest C# (CSharp) Method

Application_EndRequest() protected method

Handles the EndRequest event of the Application control.
protected Application_EndRequest ( object sender, EventArgs e ) : void
sender object The source of the event.
e System.EventArgs The instance containing the event data.
return void
        protected virtual void Application_EndRequest(object sender, EventArgs e)
        {
            if (string.IsNullOrWhiteSpace(Thread.CurrentThread.Name))
                return;

            var startTime = long.Parse(Thread.CurrentThread.Name.ReplaceAll(@"[^\d]|", string.Empty));
            var elapsed = new TimeSpan(DateTime.Now.Ticks - startTime);

            log.InfoFormat("Request completed in {0}ms.", elapsed.Milliseconds);
        }