• 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

Interface ILogger

This is the interface used for internal logging. The idea is that you can implement a small wrapper for you favorite logger which implements this interface. Assign it to the HttpExtensionsGlobals.Logger and Dapplo.HttpExtensions will start logger with your class. A TraceLogger implementation is supplied, so you can see some output while your project is in development.

Inherited Members
ILoggerConfiguration.LogLevel
ILoggerConfiguration.UseShortSource
ILoggerConfiguration.DateTimeFormat
ILoggerConfiguration.LogLineFormat
Namespace:Dapplo.Log
Assembly:Dapplo.Log.dll
Syntax
public interface ILogger : ILoggerConfiguration

Methods

| Improve this Doc View Source

Configure(ILoggerConfiguration)

Configure the logger with the values from the ILoggerConfiguration

Declaration
void Configure(ILoggerConfiguration loggerConfiguration)
Parameters
Type Name Description
ILoggerConfiguration loggerConfiguration

ILoggerConfiguration

| Improve this Doc View Source

Format(LogInfo, String, Object[])

This can be overriden to format the line message differently

Declaration
string Format(LogInfo logInfo, string messageTemplate, object[] parameters)
Parameters
Type Name Description
LogInfo logInfo
System.String messageTemplate
System.Object[] parameters
Returns
Type Description
System.String
| Improve this Doc View Source

IsLogLevelEnabled(LogLevels, LogSource)

A simple test, to see if the log level is enabled. Note: level == LogLevels.None should always return false Level == LogLevels.None is actually checked in the extension Optionally the LogSource for which this is requested is supplied and can be used.

Declaration
bool IsLogLevelEnabled(LogLevels logLevel, LogSource logSource = null)
Parameters
Type Name Description
LogLevels logLevel

LogLevels

LogSource logSource

Optional LogSource

Returns
Type Description
System.Boolean

true if enabled

| Improve this Doc View Source

ReplacedWith(ILogger)

This is called when your logger was the default, and is replaced with a different one. In this method a buffer logger could place all it's content into the new logger.

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

ILogger

| Improve this Doc View Source

Write(LogInfo, String, Object[])

This writes the LogInfo, messageTemplate and the log parameters to the log

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

LogInfo with source, timestamp, level etc

System.String messageTemplate

Message (template) with formatting

System.Object[] logParameters

Parameters for the template

| Improve this Doc View Source

WriteLine(LogInfo, Exception, String, Object[])

This writes the LogInfo, exception, messageTemplate and the log parameters to the log, finishing with a newline

Declaration
void WriteLine(LogInfo logInfo, Exception exception, string messageTemplate = null, params object[] logParameters)
Parameters
Type Name Description
LogInfo logInfo

LogInfo with source, timestamp, level etc

System.Exception exception

exception to log

System.String messageTemplate

Message (template) with formatting

System.Object[] logParameters

Parameters for the template

| Improve this Doc View Source

WriteLine(LogInfo, String, Object[])

This writes the LogInfo, messageTemplate and the log parameters to the log, finishing with a newline

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

LogInfo with source, timestamp, level etc

System.String messageTemplate

Message (template) with formatting

System.Object[] logParameters

Parameters for the template

  • Improve this Doc
  • View Source
Back to top Copyright © 2017 Dapplo