Team XSockets.NET

Usage

Since the logger is a module you use it by asking the plugin framework for the interface. One you have the instance you can use all levels of logging

  • Verbose
  • Debug
  • Information
  • Warning
  • Error
  • Fatal

Get the Instance

var logger = Composable.GetExport<IXLogger>();

Logging

All the log-levels take a template and parameters to write to the log-template. Complex object will have an @ in-front of them if you want the object to be serialized. Sample below taken from the Serilog page.

var position = new { Latitude = 25, Longitude = 134 };
var elapsedMs = 34;

logger.Information("Processed {@Position} in {Elapsed:000} ms.", position, elapsedMs);

Serilog is the default logger and even though you can replace it with a custom logger we strongly recommend you to use Serilog.

results matching ""

    No results matching ""