Sentry.Serilog doesn't log Environment
See original GitHub issuePlease mark the type framework used:
- ASP.NET MVC
- ASP.NET Web API (OWIN)
- ASP.NET Core
- WPF
- WinForms
- Xamarin
- Other:
Please mark the type of the runtime used:
- .NET Framework
- Mono
- .NET Core
- Version: 2.2.0
Please mark the NuGet packages used:
- Sentry
- Sentry.Serilog
- Sentry.NLog
- Sentry.Log4Net
- Sentry.Extensions.Logging
- Sentry.AspNetCore
Please describe the the steps to reproduce the issue or link to a repository with a small reproducible code.
Currently we use Sentry.Serilog 1.2.0, and it does not correctly display Environment, it always displays “All Environments”. We have “ASPNETCORE_ENVIRONMENT” set in the environment variables. We also use Serilog to distribute our logging, and have it configured with the config listed below.
Note: We dont use Sentry.AspNetCore for 2 reasons, 1 our console applications don’t use AspNetCore it just uses NetCore, and 2 we use Serilog to enrich data meta data and to distribute our logging.
Also note, I changed the key below for security purposes.
"Serilog": {
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{ "Name": "LiterateConsole" },
{
"Name": "Logentries",
"Args": {
"token": "99b37aaf-c472-40f7-a50f-5ab3d457f071-123",
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level:u3}] [{MachineName}] [{SourceContext}] {Message:lj}{NewLine}{Exception}"
}
},
{
"Name": "Sentry",
"Args": {
"MinimumBreadcrumbLevel": "Information",
"MinimumEventLevel": "Error",
"Dsn": "https://a16b8602ba8e46a49188c7de65af9072123@sentry.io/202852123",
"AttachStacktrace": true,
"SendDefaultPii": false
}
}
]
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (7 by maintainers)
Top GitHub Comments
@rmsy
I fixed it by implementing the following workaround in the main function of the webapp/service:
Ah, perfect–thanks @bruno-garcia !