Set Up Logs

Structured logs allow you to send, view and query logs sent from your applications within Sentry.

With Sentry Structured Logs, you can send text based log information from your applications to Sentry. Once in Sentry, these logs can be viewed alongside relevant errors, searched by text-string, or searched using their individual attributes.

Logs for .NET are supported in Sentry .NET SDK version 5.14.0 and above.

To enable logging, you need to initialize the SDK with the Experimental.EnableLogs option set to true.

Copied
SentrySdk.Init(options =>
{
    options.Dsn = "https://examplePublicKey@o0.ingest.sentry.io/0";
    // Enable logs to be sent to Sentry
    options.Experimental.EnableLogs = true;
});

Available integrations:

If there's an integration you would like to see, open a new issue on GitHub.

Sentry Structured Logs is currently in Beta and under active development. During the experimental phase of support in Sentry's .NET SDK, are are looking forward to your general feedback, both praise and problems, through Give Feedback on Sentry, our Discord server, or this GitHub discussion. Should you experience bugs or have particular feature request, please open a new issue on GitHub.

This GitHub issue tracks all bugs that we are currently fixing and improvement that we will implement during the experimental phase of the feature.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").