• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.Log
    • AbstractLogger
    • ILogger
    • ILoggerConfiguration
    • LoggerMapper
    • LogInfo
    • LogInfoExtensions
    • LogLevels
    • LogSettings
    • LogSource
    • LogSourceExtensions
    • NullLogger
  • Dapplo.Log.LogFile
    • FileLogger
    • ForwardingLogger
    • IFileLoggerConfiguration
  • Dapplo.Log.Loggers
    • ColorConsoleLogger
    • ConsoleLogger
    • DebugLogger
    • StringWriterLogger
    • TraceLogger
  • Dapplo.Log.XUnit
    • XUnitLogger

Class ForwardingLogger

This implements a logger which accepts log items, but only stores them and later forwards them to the replacement logger Can be used to setup before everything is taken care of, to later replace with the file logger. When disposed, everything in the queue is written to Trace.

Inheritance
System.Object
AbstractLogger
ForwardingLogger
Inherited Members
AbstractLogger.Configure(ILoggerConfiguration)
AbstractLogger.Format(LogInfo, String, Object[])
AbstractLogger.LogLevel
AbstractLogger.UseShortSource
AbstractLogger.DateTimeFormat
AbstractLogger.LogLineFormat
AbstractLogger.IsLogLevelEnabled(LogLevels, LogSource)
AbstractLogger.WriteLine(LogInfo, String, Object[])
AbstractLogger.WriteLine(LogInfo, Exception, String, Object[])
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace:Dapplo.Log.LogFile
Assembly:Dapplo.Log.LogFile.dll
Syntax
public class ForwardingLogger : AbstractLogger, ILogger, ILoggerConfiguration, IDisposable

Methods

| Improve this Doc View Source

Dispose()

Dispose takes care of cleaning all logged items

Declaration
public void Dispose()
Implements
System.IDisposable.Dispose()
| Improve this Doc View Source

ReplacedWith(ILogger)

Pass all the written items on to the next logger

Declaration
public override void ReplacedWith(ILogger newLogger)
Parameters
Type Name Description
ILogger newLogger

ILogger which replaces this

Overrides
AbstractLogger.ReplacedWith(ILogger)
| Improve this Doc View Source

Write(LogInfo, String, Object[])

Enqueue the current information so it can be written to the file, formatting is done later.. (improves performance for the UI) Preferably do NOT pass huge objects which need to be garbage collected

Declaration
public override void Write(LogInfo logInfo, string messageTemplate, params object[] logParameters)
Parameters
Type Name Description
LogInfo logInfo

LogInfo

System.String messageTemplate

string

System.Object[] logParameters

params

Overrides
AbstractLogger.Write(LogInfo, String, Object[])
  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo