You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Or you can configure Honeybadger through your `appsettings.json` file, by adding a `Honeybadger` section:
@@ -46,6 +45,8 @@ Or you can configure Honeybadger through your `appsettings.json` file, by adding
46
45
}
47
46
}
48
47
```
48
+
**Note**: You should probably set your API key through environment variables or use the Secrets Manager, instead of hardcoding it in the `appsettings.json` file.
49
+
You can read the [official documentation](https://learn.microsoft.com/en-us/aspnet/core/security/app-secrets) for more information on how to do that in a .Net Core app.
49
50
50
51
And simply call `AddHoneybadger` without any parameters:
51
52
@@ -59,15 +60,15 @@ builder.AddHoneybadger();
59
60
You can access the _Honeybadger Client_ using _DI_:
Note: If you want to disable automatic reporting of unhandled exceptions, you can set the `ReportUnhandledExceptions` property to `false` in the `HoneybadgerOptions`:
120
-
121
-
```json
122
-
{
123
-
"Honeybadger": {
124
-
"ApiKey": "{{PROJECT_API_KEY}}",
125
-
"AppEnvironment": "Development",
126
-
"ReportData": true,
127
-
"ReportUnhandledExceptions": false
128
-
}
129
-
}
130
-
```
131
-
132
123
#### Usage
133
124
134
125
Errors from the `logger` will be reported to Honeybadger:
0 commit comments