Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Roy Berris 89 posts 576 karma points c-trib
    Dec 10, 2021 @ 07:55
    Roy Berris
    0

    How to use Sentry with Umbraco 8.17

    Hi, does anyone use Sentry.io for error logging and performance monitoring?

    First thing I noticed is that the System.Immutable package is still on version 1.7 for Umbraco while Sentry requires > 6.0.0.

    I (think I) fixed that by adding a new project, which had the Sentry related stuff.

    I created a component which hooks in to UmbracoApplicationBase.ApplicationInit this will register a handler for HttpApplication.Error. And where I call SentrySdk.Init.

    In there I had a reference to the other project running Sentry. Which calls the SentrySdk.CaptureException.

    I also hook in to UmbracoApplicationBase.ApplicationEnd where I Dispose the Sentry Init disposable.

    This succeeds, now I do not close the program immediately but wait for the program to run. So the Sentry queue can finish sending requests. But nothing goes in to Sentry, it doesn't have any issues.


    I have two questions about this. Am I doing something wrong when catching the exception from Umbraco?

    How can I make Sentry hook in to the Umbraco logging so I can see what it is doing?

  • Roy Berris 89 posts 576 karma points c-trib
    Dec 17, 2021 @ 08:25
    Roy Berris
    100

    For someone who is interested in the future. Umbraco 9 works out of the box in a minute so thats good.

    For our setup we had to add some version rewrite on the conflicting System packages. To point from 0.0.0-5.0.0 to 5.0.0.

    The project ran, and Sentry did compile and initialize. But the CaptureException threw an (internal) exception that it could not load the right packages.

    After resolving the conflicts with a rewrite it works.

    Good to look out when doing things like this because it can break existing code.

Please Sign in or register to post replies

Write your reply to:

Draft