/// <summary> /// Initializes the target. /// </summary> protected override void InitializeTarget() { base.InitializeTarget(); _buffer = new LogEventInfoBuffer(BufferSize, false, 0); InternalLogger.Trace("BufferingWrapper(Name={0}): Create Timer", Name); _flushTimer = new Timer(FlushCallback, null, Timeout.Infinite, Timeout.Infinite); }
/// <summary> /// Initializes the target. /// </summary> protected override void InitializeTarget() { base.InitializeTarget(); this.buffer = new LogEventInfoBuffer(this.BufferSize, false, 0); InternalLogger.Trace("BufferingWrapper '{0}': create timer", Name); this.flushTimer = new Timer(this.FlushCallback, null, Timeout.Infinite, Timeout.Infinite); }
/// <summary> /// Adds the specified log event to the buffer. /// </summary> /// <param name="logEvent">The log event.</param> public override void Write(LogEventInfo logEvent) { WrappedTarget.PrecalculateVolatileLayouts(logEvent); LogEventInfoBuffer buffer = GetRequestBuffer(); if (buffer != null) { buffer.Append(logEvent); } }
private void OnEndRequest(object sender, EventArgs args) { LogEventInfoBuffer buffer = GetRequestBuffer(); if (buffer != null) { InternalLogger.Trace("Sending buffered events to wrapped target: {0}.", WrappedTarget); AsyncLogEventInfo[] events = buffer.GetEventsAndClear(); WrappedTarget.WriteAsyncLogEvents(events); } }
private void OnEndRequest(object sender, EventArgs args) { LogEventInfoBuffer buffer = GetRequestBuffer(); if (buffer != null) { LogEventInfo[] events = buffer.GetEventsAndClear(); if (events.Length > 0) { WrappedTarget.Write(events); } } }
/// <summary> /// Adds the specified log event to the buffer. /// </summary> /// <param name="logEvent">The log event.</param> protected override void Write(AsyncLogEventInfo logEvent) { LogEventInfoBuffer buffer = GetRequestBuffer(); if (buffer != null) { WrappedTarget.PrecalculateVolatileLayouts(logEvent.LogEvent); buffer.Append(logEvent); InternalLogger.Trace("Appending log event {0} to ASP.NET request buffer.", logEvent.LogEvent.SequenceID); } else { InternalLogger.Trace("ASP.NET request buffer does not exist. Passing to wrapped target."); WrappedTarget.WriteAsyncLogEvent(logEvent); } }
/// <summary> /// Initializes the target. /// </summary> protected override void InitializeTarget() { base.InitializeTarget(); this.buffer = new LogEventInfoBuffer(this.BufferSize, false, 0); this.flushTimer = new Timer(this.FlushCallback, null, -1, -1); }
/// <summary> /// Initializes the target. /// </summary> protected override void InitializeTarget() { base.InitializeTarget(); this.buffer = new LogEventInfoBuffer(this.BufferSize, false, 0); this.flushTimer = new Timer(this.FlushCallback, null, -1, -1); }
/// <summary> /// Initializes a new instance of the <see cref="LogReceiverWebServiceTarget"/> class. /// </summary> public LogReceiverWebServiceTarget() { this.Parameters = new List <MethodCallParameter>(); this.buffer = new LogEventInfoBuffer(10000, false, 10000); }
/// <summary> /// Initializes the target. /// </summary> protected override void InitializeTarget() { base.InitializeTarget(); this.buffer = new LogEventInfoBuffer(this.BufferSize, false, 0); InternalLogger.Trace("BufferingWrapper '{0}': start timer", Name); this.flushTimer = new Timer(this.FlushCallback, null, -1, -1); }