Giter Club home page Giter Club logo

Comments (5)

bruno-garcia avatar bruno-garcia commented on June 1, 2024

@dglasl It seems the problem is the DSN.

You need to replace that string with your actual DSN. You get one when you create a project with Sentry.

One way to do go is to sign up with sentry.io. There you get your DSN (which is a URI like https://[email protected]/more-stuff.

Add that to your sample instead of the string DSN.
After that, when a crash happens, you'll see the event in your Sentry project.

Like this example (which has my DSN):

<!--Defining the DSN here allows log4net integration to initialize the SDK-->
<!--You can leave the DSN out of this configuration file and initialize the SDK-->
<!--via code (SentrySdk.Init) or via another integration like ASP.NET-->
<!--The SDK only needs to be initialized once, you can choose where to do that-->
<Dsn value="https://[email protected]/1188141" />

from sentry-dotnet.

dglasl avatar dglasl commented on June 1, 2024

Hello and thank you very much for your answer.
I forgot to mention that in the place of DSN there is of course a real one and I only censored it.
Also, if I register the DSN in the .config file, the error logging works and I see the error in Sentry.

from sentry-dotnet.

bruno-garcia avatar bruno-garcia commented on June 1, 2024

@dglasl Sorry I misunderstood the issue.

This was indeed a bug.

The Appender, when not Initializing the SDK by itself, decided not to use the Hub at all, even if that was already enabled. Then not sending events at all.

I've pushed a fix which simply checks if the current Hub is already enabled. If it is, it'll carry on using that instead of trying to initialize a new one.

If you are currently blocked by this, please note the Release can also be set via the attributes AssemblyInformationalVersion or AssemblyVersion (which can also be set via csproj or also via environment variable SENTRY_RELESE in the session/process or machine running the code.

One last note, please make sure to hold on to the IDisposable returned by SentrySdk.Init and dispose it at the end of the application execution. This makes sure any queued up event gets flushed out to Sentry before the app terminates.

If the SDK is initialized via a Program.cs Main method, this can be done like:

using (SentrySdk.Init())
{
  // app code ..
}

from sentry-dotnet.

dglasl avatar dglasl commented on June 1, 2024

Thank you very much the quick answer and the fix!
I really appreciate it.

from sentry-dotnet.

bruno-garcia avatar bruno-garcia commented on June 1, 2024

@dglasl thank you for using it and reporting.

from sentry-dotnet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.