Exemplo n.º 1
0
        private void FinalizeRequestProcessing(IHttpContext ctx, Stopwatch sw, bool ravenUiRequest)
        {
            LogHttpRequestStatsParams logHttpRequestStatsParam = null;

            try
            {
                logHttpRequestStatsParam = new LogHttpRequestStatsParams(
                    sw,
                    ctx.Request.Headers,
                    ctx.Request.HttpMethod,
                    ctx.Response.StatusCode,
                    ctx.Request.Url.PathAndQuery);
            }
            catch (Exception e)
            {
                logger.Warn("Could not gather information to log request stats", e);
            }

            ctx.FinalizeResonse();
            sw.Stop();

            if (ravenUiRequest || logHttpRequestStatsParam == null)
            {
                return;
            }

            LogHttpRequestStats(logHttpRequestStatsParam);
            ctx.OutputSavedLogItems(logger);
        }
Exemplo n.º 2
0
        public void HandleActualRequest(IHttpContext ctx)
        {
            var  sw             = Stopwatch.StartNew();
            bool ravenUiRequest = false;

            try
            {
                ravenUiRequest = DispatchRequest(ctx);
            }
            catch (Exception e)
            {
                HandleException(ctx, e);
                logger.Warn("Error on request", e);
            }
            finally
            {
                ctx.FinalizeResonse();
                // we filter out requests for the UI because they fill the log with information
                // we probably don't care about
                if (ravenUiRequest == false)
                {
                    var curReq = Interlocked.Increment(ref reqNum);
                    logger.DebugFormat("Request #{0,4:#,0}: {1,-7} - {2,5:#,0} ms - {5,-10} - {3} - {4}",
                                       curReq, ctx.Request.HttpMethod, sw.ElapsedMilliseconds, ctx.Response.StatusCode,
                                       ctx.Request.Url.PathAndQuery,
                                       currentTenantId.Value);

                    ctx.OutputSavedLogItems(logger);
                }
            }
        }
Exemplo n.º 3
0
        public void Disconnect()
        {
            if (heartbeat != null)
            {
                heartbeat.Dispose();
            }

            Connected = false;
            Disconnected();
            context.FinalizeResonse();
        }
Exemplo n.º 4
0
        public void HandleActualRequest(IHttpContext ctx)
        {
            var  sw             = Stopwatch.StartNew();
            bool ravenUiRequest = false;

            try
            {
                ravenUiRequest = DispatchRequest(ctx);
            }
            catch (Exception e)
            {
                HandleException(ctx, e);
                logger.Warn("Error on request", e);
            }
            finally
            {
                ctx.FinalizeResonse();
                sw.Stop();

                LogHttpRequestStats(ctx, sw, ravenUiRequest);
            }
        }
Exemplo n.º 5
0
 public void HandleActualRequest(IHttpContext ctx)
 {
     var curReq = Interlocked.Increment(ref reqNum);
     var sw = Stopwatch.StartNew();
     try
     {
         DispatchRequest(ctx);
     }
     catch (Exception e)
     {
         HandleException(ctx, e);
         logger.WarnFormat(e, "Error on request #{0}", curReq);
     }
     finally
     {
         ctx.FinalizeResonse();
         logger.DebugFormat("Request #{0,4:#,0}: {1,-7} - {2,5:#,0} ms - {3} - {4}",
                                curReq, ctx.Request.HttpMethod, sw.ElapsedMilliseconds, ctx.Response.StatusCode, ctx.Request.Url.PathAndQuery);
     }
 }
Exemplo n.º 6
0
		private void FinalizeRequestProcessing(IHttpContext ctx, Stopwatch sw, bool ravenUiRequest)
		{
			LogHttpRequestStatsParams logHttpRequestStatsParam = null;
			try
			{
				logHttpRequestStatsParam = new LogHttpRequestStatsParams(
					sw,
					ctx.Request.Headers,
					ctx.Request.HttpMethod,
					ctx.Response.StatusCode,
					ctx.Request.Url.PathAndQuery);
			}
			catch (Exception e)
			{
				logger.WarnException("Could not gather information to log request stats", e);
			}

			ctx.FinalizeResonse();
			sw.Stop();

			if (ravenUiRequest || logHttpRequestStatsParam == null)
				return;

			LogHttpRequestStats(logHttpRequestStatsParam);
			ctx.OutputSavedLogItems(logger);
		}
Exemplo n.º 7
0
		public void HandleActualRequest(IHttpContext ctx)
		{
			var sw = Stopwatch.StartNew();
		    bool ravenUiRequest = false;
            try
			{
			    ravenUiRequest = DispatchRequest(ctx);
			}
			catch (Exception e)
			{
				HandleException(ctx, e);
			    logger.Warn("Error on request", e);
			}
			finally
			{
				ctx.FinalizeResonse();
                // we filter out requests for the UI because they fill the log with information
                // we probably don't care about
                if (ravenUiRequest == false)
                {
                    var curReq = Interlocked.Increment(ref reqNum);
                    logger.DebugFormat("Request #{0,4:#,0}: {1,-7} - {2,5:#,0} ms - {3} - {4}",
                                       curReq, ctx.Request.HttpMethod, sw.ElapsedMilliseconds, ctx.Response.StatusCode,
                                       ctx.Request.Url.PathAndQuery);}
			}
		}
Exemplo n.º 8
0
        public void HandleActualRequest(IHttpContext ctx)
        {
            var sw = Stopwatch.StartNew();
            bool ravenUiRequest = false;
            try
            {
                ravenUiRequest = DispatchRequest(ctx);
            }
            catch (Exception e)
            {
                HandleException(ctx, e);
                logger.Warn("Error on request", e);
            }
            finally
            {
                ctx.FinalizeResonse();
				sw.Stop();
                
                LogHttpRequestStats(ctx, sw, ravenUiRequest);
            }
        }