private static void FormatErrorMessage(StringBuffer stringBuffer, IInternalLogEvent logEvent) { stringBuffer.Clear(); stringBuffer.Append("An error occured during formatting: "); logEvent.WriteToStringBufferUnformatted(stringBuffer); }
private static void WriteMessageLogToAppenders(byte[] destination, IInternalLogEvent logEvent, int bytesWritten) { foreach (var appender in logEvent.Appenders) { // if (logEvent.Level >= Level) // TODO Check this ? log event should not be in queue if not > Level appender.WriteEvent(logEvent, destination, bytesWritten); } }
private void WriteMessageLogToAppenders(byte[] destination, IInternalLogEvent logEvent, int bytesWritten) { var appenders = logEvent.Appenders; for (var i = 0; i < appenders.Count; i++) { var appender = appenders[i]; // if (logEvent.Level >= Level) // TODO Check this ? log event should not be in queue if not > Level appender.WriteEvent(logEvent, destination, bytesWritten); } }
private static void HandleFormattingError(StringBuffer stringBuffer, IInternalLogEvent logEvent, byte[] destination, out int bytesWritten) { try { stringBuffer.Clear(); stringBuffer.Append("An error occured during formatting: "); logEvent.WriteToStringBufferUnformatted(stringBuffer); bytesWritten = CopyStringBufferToByteArray(stringBuffer, destination); } catch (Exception ex) { stringBuffer.Clear(); stringBuffer.Append("An error occured during formatting: "); stringBuffer.Append(ex.Message); bytesWritten = CopyStringBufferToByteArray(stringBuffer, destination); } }
internal void Enqueue(IInternalLogEvent logEvent) { _logManager.Enqueue(logEvent); }
private static void FormatLogMessage(StringBuffer stringBuffer, IInternalLogEvent logEvent) { stringBuffer.Clear(); logEvent.WriteToStringBuffer(stringBuffer); }
void IInternalLogManager.Enqueue(IInternalLogEvent logEvent) => _queue.Enqueue(logEvent);
public void Enqueue(IInternalLogEvent logEvent) => throw new NotSupportedException();
public ForwardingLogEvent(IInternalLogEvent logEventToAppend) { _logEventToAppend = logEventToAppend; }
public ForwardingLogEvent(IInternalLogEvent logEventToAppend, Log log) { _logEventToAppend = logEventToAppend; _log = log; }
public ForwardingLogEvent([NotNull] IInternalLogEvent logEventToAppend, [NotNull] Log log) { _logEventToAppend = logEventToAppend; _log = log; }
public IInternalLogEvent AllocateLogEvent(LogEventPoolExhaustionStrategy logEventPoolExhaustionStrategy, IInternalLogEvent logEvent, Level level, Log log) => throw new NotSupportedException();
IInternalLogEvent IInternalLogManager.AllocateLogEvent(LogEventPoolExhaustionStrategy logEventPoolExhaustionStrategy, IInternalLogEvent notifyPoolExhaustionLogEvent, Level level, Log log) { IInternalLogEvent Initialize(IInternalLogEvent l) { l.Initialize(level, log); return(l); } if (_pool.TryAcquire(out var logEvent)) { return(Initialize(logEvent)); } switch (logEventPoolExhaustionStrategy) { case LogEventPoolExhaustionStrategy.WaitForLogEvent: return(Initialize(AcquireLogEvent())); case LogEventPoolExhaustionStrategy.DropLogMessage: return(NoopLogEvent.Instance); default: return(notifyPoolExhaustionLogEvent); } }