How to set Logger on newer SDK?

I just switched our .NET app to use the newer SDK - and I do not see a way to set the Logger like I did before?

Maybe we should be using a custom tag instead?

Logger is still there, it’s a property on the event. Are you using a logging integration? If yes, which one? It should be populating that automatically.

In raven it was sending “root” for logger on all events. We removed that so by default sends nothing.

We’re using the JavaScript and C# integrations - upgrading from the older SDK to newest one. The old SDK had a specific “logger” property you could overwrite. We were using this to indicate like “ClientsideReact”, “ClientsideUnexpected”, “ClientsideLog”, “Serverside” etc - depending on the context of what logger was doing the action. I tried setting “Logger” as a tag, but that didn’t seem to work.

Thanks for taking the time to migrate the SDKs. Just to clarify, this is related to the .NET SDK only, right? Or are you also talking about JS now?

Could you please share some snippets on how you are doing that?
Are you using any logging integration?

Here’s an example of log4net:

The SDK itself will use the logger category as the Sentry logger field. Same with NLog, etc.

Logger exists in the SentryEvent. So you can set the logger like:

SentrySdk.CaptureEvent(new SentryEvent { Logger = "logger-name" });

Are you using any other package like Sentry.AspNetCore?
What type of app is it?

Bruno,

Thanks for replying and helping me here. I think my doc-reading failed me or maybe the docs can be improved. I was using SentrySdk.ConfigureScope to set user parameters, tags, etc - and didn’t see Logger as part of that - I didn’t realize I could just make a SentryEvent from the exception and set parameters on their instead of using ConfigureScope.

For clientside, I’ve migrating from the raven stuff to newest API - and trying to set up the Sentry logic that will catch unhandled exceptions:

    Sentry.init({

            dsn: '(my url here)',

            release: 'myapp@2020.1.1',

            environment: 'staging',

        });

        Sentry.setUser({

            email: 'test@test.com',

            username: 'test@test.com',

            id: 12345,

         });

         Sentry.setTag('site_section', 'homepage');

         Sentry.setTag('logger', 'Clientside');

But using .setTag in this way doesn’t work as far as I can tell.