Logging configuration

The API uses a pluggable logging system. The logging system is compatible with popular .NET logging frameworks such as Log4Net and NLog. Loggers are registered with the API via the Service class. All core logging is based on the client choice of logger. An example implementation of a Log4Net logger is provided here

Additionally, diagnostic info for logging of errors specific to log4net itself has also been configured in the Demo application’s .config file.

Log4net is based on the idea of log levels:

  • ALL
  • TRACE (only supported here though extension methods)
  • DEBUG
  • INFO
  • WARN
  • ERROR
  • FATAL
  • OFF

In practice, the only log levels in use here are: TRACE, DEBUG, INFO, WARN, ERROR (in order of increasing priority). You can implement other loggers as the system is using a generic pluggable logger.

The API logging system requires that your logger is derived from the System.Diagnostics.TraceListener class. You may need to wrap your logger if this is not the case.