serilog-sinks-sentry icon indicating copy to clipboard operation
serilog-sinks-sentry copied to clipboard

Enviroment tag is not filled

Open staticdev opened this issue 6 years ago • 4 comments

Default sentry dehavior fill environment tag with ASPNETCORE_ENVIRONMENT variable. But with I use Serilog, this tag comes empty.

staticdev avatar Jun 24 '19 17:06 staticdev

The sink uses the legacy Sentry library which is not Core-aware https://github.com/getsentry/raven-csharp I'd recommend using the official Sentry sink for ASP.NET Core projects https://www.nuget.org/packages/Sentry.Serilog

olsh avatar Jun 25 '19 11:06 olsh

@olsh Thanks for the info. That infomation is not clear from what is in the README of this project. Maybe it's worth adding that.

staticdev avatar Jun 26 '19 17:06 staticdev

@staticdev You know you can also manually set that value. E.g.

    "Serilog": {
        "Using": [ "Serilog.Sinks.Async", "Sentry.Serilog" ],
        "MinimumLevel": {
            "Default": "Warning",
            "Override": {
                "Sentry": "Error"
            }
        },
        "WriteTo": [
            {
                "Name": "Async",
                "Args": {
                    "configure": [
                        {
                            "Name": "Console"
                        },
                        {
                            "Name": "Sentry",
                            "Args": {
                                "Dsn": "<snip>",
                                "AttachStacktrace": "true",
                                "Environment": "Production"
                            }
                        }
                    ]
                }
            }
        ]
    },

PureKrome avatar Aug 07 '19 04:08 PureKrome

Yes @PureKrome but that is not what I want. I want to ge the already defined variables, not define new ones. Sentry official library does this by default.

staticdev avatar Aug 09 '19 11:08 staticdev