A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/serilog/serilog-sinks-exceptionless below:

exceptionless/serilog-sinks-exceptionless: Writes events from Serilog to the Exceptionless logging service.

Serilog.Sinks.Exceptionless

To use the Exceptionless sink, first install the NuGet package:

Install-Package Serilog.Sinks.Exceptionless

Next, we need to ensure that Exceptionless is configured with an API Key. If you are already using Exceptionless you can skip this step.

The Exceptionless sink will use the default ExceptionlessClient client instance. This ensures that all of your Exceptionless configuration is shared with the sink and also enables logging of unhandled exceptions to Exceptionless.

For advanced users who wish to configure the sink to use custom ExceptionlessClient instance you can provide an API Key or ExceptionlessClient instance to WriteTo.Exceptionless().

using Exceptionless;
ExceptionlessClient.Default.Startup("API_KEY");

Next, enable the sink using WriteTo.Exceptionless()

Log.Logger = new LoggerConfiguration()
    .WriteTo.Exceptionless(b => b.AddTags("Serilog Example"))
    .CreateLogger();

To get tags to populate on the exceptionless UI, add a Tags string enumerable to any log.

using var _ = _logger.BeginScope(new Dictionary<string, object> { ["Tags"] = new string[] { "Tag1", "Tag2" }});
_logger.Log(logLevel, eventId, state, exception, formatter);

Copyright © 2023 Serilog Contributors - Provided under the Apache License, Version 2.0.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4