Configuration options

All available options for configuring your integration with Bugsnag.

You can configure Bugsnag in code or through the Configuration API. Each key provides an in code example and if possible a json config file example. In an ASP.NET Core application you can use the following line to configure Bugsnag using the available configuration providers.

services.Configure<Bugsnag.Configuration>(Configuration.GetSection("Bugsnag"));

API Key

Your Bugsnag API key (required)

configuration.ApiKey = "your-api-key"
{
  "Bugsnag": {
    "ApiKey": "your-api-key"
  }
}

App Type

You can set the type of application executing the current code by using this key.

configuration.AppType = "worker";
{
  "Bugsnag": {
    "AppType": "worker"
  }
}

App Version

If you want to track which versions of your application each exception happens in, you can set AppVersion.

configuration.AppVersion = "2.5.1";
{
  "Bugsnag": {
    "AppVersion": "2.5.1"
  }
}

Auto Capture Sessions

Set to true if you would like Bugsnag to automatically capture sessions. Using this option in a web framework that we support will report a session each time a request is received.

configuration.AutoCaptureSessions = true;
{
  "Bugsnag": {
    "AutoCaptureSessions": true
  }
}

Auto Notify

By default we will automatically notify Bugsnag of any fatal exceptions in your application. Use this option if you want to stop this from happening.

configuration.AutoNotify = false;
{
  "Bugsnag": {
    "AutoNotify": false
  }
}

Endpoint

Sets the URL used to send error reports to Bugsnag. This defaults to https://notify.bugsnag.com, but should be overridden if you are using Bugsnag On-premise, to point to your own Bugsnag endpoint.

configuration.Endpoint = new Uri("https://bugsnag.internal.example.com");
{
  "Bugsnag": {
    "Endpoint": "https://bugsnag.internal.example.com"
  }
}

Global Metadata

Metadata that will be attached to all error reports sent by the client.

configuration.GlobalMetadata = new[] { new KeyValuePair<string, object>("account", new System.Collections.Generic.Dictionary<string, string> { { "company", "Acme Co." } }) };

Ignore Classes

A list of exception types that should be ignored. If a report contains exceptions of these types then the report will not be sent to Bugsnag. Checks to see if each exception type is in the inheritance hierarchy of each IgnoreClass or is an interface that the exception implements.

configuration.IgnoreClasses = new [] { typeof(Bugsnag.NotThatBadException), typeof(System.NotImplementedException) };

Maximum Breadcrumbs

This is the maximum number of breadcrumbs that will be sent along with each error report. The maximum payload size is 1MB and breadcrumbs will be stripped if the client is unable to send the report due to a large number of breadcrumbs. The defualt value for this is 25.

configuration.MaximumBreadcrumbs = 25;
{
  "Bugsnag": {
    "MaximumBreadcrumbs": 25
  }
}

Metadata Filters

Sets which keys should be filtered out from metadata before sending them to Bugsnag. Use this if you want to ensure you don’t send sensitive data such as passwords, and credit card numbers to our servers. Any keys in the metadata of the error report will have their values replaces with [FILTERED]. By default these are populated with the following values: “password”, “Authorization”.

configuration.MetadataFilters = new [] { "password", "creditcard" };
{
  "Bugsnag": {
    "MetadataFilters": ["password", "creditcard"]
  }
}

Notify Release Stages

By default, we will notify Bugsnag of exceptions that happen in any ReleaseStage. If you would like to change which release stages notify Bugsnag of exceptions you can set NotifyReleaseStages:

configuration.NotifyReleaseStages = new [] { "staging", "production" };
{
  "Bugsnag": {
    "NotifyReleaseStages": ["staging", "production"]
  }
}

Project Namespaces

We mark stacktrace lines as inProject if they come from namespaces included in your project namespaces.

configuration.ProjectNamespaces = new [] { "App.Code", "Bugsnag.Tests" };
{
  "Bugsnag": {
    "ProjectNamespaces": ["App.Code", "Bugsnag.Tests"]
  }
}

Project Roots

Project roots are used to strip file paths in each error reports stack trace in order to normalize them across builds.

configuration.ProjectRoots = new [] { @"C:\app", @"D:\src" };
{
  "Bugsnag": {
    "ProjectRoots": ["C:\app", "D:\src"]
  }
}

Proxy

Sets the address of the HTTP proxy that should be used for requests to Bugsnag. You can also provide authentication details.

var credential = new System.Net.NetworkCredential(username, password);
var proxyAddress = new Uri("https://hostname:port");
configuration.Proxy = new System.Net.WebProxy(proxyAddress, false, null, credential);

Release Stage

If you would like to distinguish between errors that happen in different stages of the application release process (development, production, etc) you can set the ReleaseStage that is reported to Bugsnag. This will default to production if not specified.

configuration.ReleaseStage = "development";
{
  "Bugsnag": {
    "ReleaseStage": "development"
  }
}

Session Endpoint

Set the endpoint to which tracked sessions reports are sent. This defaults to https://sessions.bugsnag.com, but should be overridden if you are using Bugsnag On-premise, to point to your own Bugsnag endpoint.

configuration.SessionEndpoint = new Uri("https://sessions.example.com");
{
  "Bugsnag": {
    "SessionEndpoint": "https://sessions.example.com"
  }
}