SeriLog for .Net Core SeriLog for .Net Core

If you are using SeriLog as your logger in .Net Core, you can use Coralogix Sink to push logs to your Coralogix Account.

The first thing you need to do is fetch SeriLog.Sinks.Coralogix from NuGet

Coralogix Sinks needs to be configured with your PrivateKey ApplicationName and SubSystemName.

Here is an example:

using Serilog.Sinks.Coralogix;
using Serilog;

var log = new LoggerConfiguration()
                .WriteTo.CoralogixSink(new CoralogixSinkOptions
                    PrivateKey = "xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx",
                    ApplicationName = "myApp",
                    SubsystemName = "mySubs"

If your Coralogix account domain ends up in .us or .in you need to set up your endpoint URL accordingly.

For .us:

set env-var CORALOGIX_LOG_URL=""

For .in:

set env-var CORALOGIX_LOG_URL=""

On this page