Skip to content

How to add attachment to unhandled exception in MAUI? #3346

Discussion options

You must be logged in to vote

Hey there! I think you're looking for the BeforeSend callback. The callback provides a Hint object that takes paths as attachments that then get added to the event during later stages of eventprocessing.
It'd look a bit like this

.UseSentry(options =>
{
    options.SetBeforeSend((sentryEvent, hint) =>
    {
        hint.AddAttachment("path/to/my/logs.log");
        return sentryEvent;
    });
});

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lubiepomaranczki
Comment options

Answer selected by bitsandfoxes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants