EventLogger

Creates an event logger.

Inherits: Logger

Description

The EventLogger allows you to create an event logger.

Instance methods

Write

Writes a log message to the logger destination(s).

public override void Write(LogLevel level, string correlation_id, Exception error, string message)

  • level: LogLevel - a log level.
  • correlation_id: string - (optional) transaction id to trace execution through call chain.
  • error: Exception - an error object associated with this message.
  • message: string - a human-readable message to log.

Examples

var logger = new EventLogger();
logger.Level = LogLevel.Debug;

logger.Error("123", ex, "Error occured: %s", ex.Message);
logger.Debug("123", "Everything is OK.");

See also