Skip to content

Serilog ITelemetryConsumer and ILogConsumer implementations for Orleans.

License

Notifications You must be signed in to change notification settings

OrleansContrib/Orleans.Telemetry.SerilogConsumer

Repository files navigation

Orleans.Telemetry.SerilogConsumer

Build status

This is a Serilog ILogConsumer and ITelemetryConsumer for Orleans. Default-constructed instances (ie, OrleansConfiguration.xml) will write incoming log messages and trace events to the default Serilog.Log.Logger. You can also create instances in code and which will allow you to configure the Serilog logging instance.

Add a TelemetryConsumer element to the OrleansConfiguration.xml file like this:

<Defaults>
  <Telemetry>
    <TelemetryConsumer Assembly="Orleans.Telemetry.SerilogConsumer" Type="Orleans.Telemetry.SerilogConsumer.SerilogConsumer" />
  </Telemetry>
</Defaults>

Or register in code before initializing the Orleans Silo:

var logger = new Serilog.LoggerConfiguration()
    .WriteTo.LiterateConsole()
    .CreateLogger();
var serilogConsumer = new SerilogConsumer(logger);

LogManager.LogConsumers.Add(serilogConsumer);
LogManager.TelemetryConsumers.Add(serilogConsumer);

About

Serilog ITelemetryConsumer and ILogConsumer implementations for Orleans.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages