Joutsen Logging v0.5.0+26-g72240ac
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
Joutsen.Logging.AsyncLogger Class Reference

A logger that uses the async framework to handle writing of log records. More...

Public Member Functions

 AsyncLogger ()
 Creates a new instance of the logger.
 
override Guid Log (LogRecord record)
 Logs a record.
 
override void Dispose ()
 Waits until all async tasks are completed before disposingof resources.
 
- Public Member Functions inherited from Joutsen.Logging.DefaultLogger
 DefaultLogger ()
 
void AddHandler (Handler handler)
 Adds a new output handler which will be notified whenever a log record should be written.
 
void RemoveHandler (Handler handler)
 Removes an output handler that should no longer be notified to write log records.
 
override void Dispose ()
 Frees all handlers and resources.
 
- Public Member Functions inherited from Joutsen.Logging.AbstractLogger
void Dispose ()
 
Guid Log (LogLevel level, string message, params object[] parameters)
 Logs a message of a specific log level.
 
Guid Log (LogLevel level, string message, object parameter)
 Logs a message of a specific log level.
 
Guid Log (LogLevel level, string message, Map< string, object > parameters)
 Logs a message of a specific log level.
 
Guid Log (LogLevel level, string message, IEnumerable listParameter)
 Logs a message of a specific log level with a list as parameter.
 
Guid Error (Exception exception, string message, Map< string, object > parameters)
 Logs an exception with an additional message.
 
Guid Error (Exception exception, string message, object parameter)
 Logs an exception with an additional message.
 
Guid Error (Exception exception, string message, params object[] parameters)
 Logs an exception with an additional message.
 
Guid Error (Exception exception)
 Logs an System.Exception as an error.
 
Guid Error (string message, Map< string, object > parameters)
 Logs an error message with parameters.
 
Guid Error (string message, object parameter)
 Logs an error message with parameters.
 
Guid Error (string message, params object[] parameters)
 Logs an error message with parameters.
 
Guid Error (string message, IEnumerable listParameter)
 Logs an error message with a list.
 
Guid Warning (string message, Map< string, object > parameters)
 Logs a warning message with parameters.
 
Guid Warning (string message, object parameter)
 Logs a warning message with parameters.
 
Guid Warning (string message, params object[] parameters)
 Logs a warning message with parameters.
 
Guid Warning (string message, IEnumerable listParameter)
 Logs an warning message with a list.
 
Guid Info (string message, Map< string, object > parameters)
 Logs an informational message with parameters.
 
Guid Info (string message, object parameter)
 Logs an informational message with parameters.
 
Guid Info (string message, params object[] parameters)
 Logs an informational message with parameters.
 
Guid Info (string message, IEnumerable listParameter)
 Logs an informational message with a list.
 
Guid Detail (string message, Map< string, object > parameters)
 Logs a detail message with parameters.
 
Guid Detail (string message, object parameter)
 Logs a detail message with parameters.
 
Guid Detail (string message, params object[] parameters)
 Logs a detail message with parameters.
 
Guid Detail (string message, IEnumerable listParameter)
 Logs a detail message with a list.
 
Guid Verbose (string message, Map< string, object > parameters)
 Logs a verbose message with parameters.
 
Guid Verbose (string message, object parameter)
 Logs a verbose message with parameters.
 
Guid Verbose (string message, params object[] parameters)
 Logs a verbose message with parameters.
 
Guid Verbose (string message, IEnumerable listParameter)
 Logs a verbose message with a list.
 

Protected Member Functions

void LogAsync (LogRecord record)
 Logs a record using the async framework.
 
- Protected Member Functions inherited from Joutsen.Logging.DefaultLogger
override bool IsLoggable (LogRecord record)
 Checks if a record is loggabe by this instance of a logger.
 

Additional Inherited Members

- Properties inherited from Joutsen.Logging.DefaultLogger
virtual Filter Filter [get, set]
 The filter for the records passed to the logger.
 
- Events inherited from Joutsen.Logging.AbstractLogger
Action< LogRecord > Publish
 

Detailed Description

A logger that uses the async framework to handle writing of log records.

Remarks
This logger can reduce the performance impact of writing log entries on systems that can easily handle multiple threads.
Since
0.4.0

Constructor & Destructor Documentation

◆ AsyncLogger()

Joutsen.Logging.AsyncLogger.AsyncLogger ( )

Creates a new instance of the logger.

Member Function Documentation

◆ Dispose()

override void Joutsen.Logging.AsyncLogger.Dispose ( )

Waits until all async tasks are completed before disposingof resources.

◆ Log()

override Guid Joutsen.Logging.AsyncLogger.Log ( LogRecord  record)
virtual

Logs a record.

Parameters
recordthe record to be logged
Returns
the id of the logged record or an empty System.Guid if the record was filtered out

Reimplemented from Joutsen.Logging.AbstractLogger.

◆ LogAsync()

void Joutsen.Logging.AsyncLogger.LogAsync ( LogRecord  record)
protected

Logs a record using the async framework.

Parameters
recordthe record to be logged
Remarks
The method information will still be loaded in the main thread because it is usually not available in other threads. If obtaining this information is the biggest performance impact, it might be better to use a synchronous logger.