sentry-java icon indicating copy to clipboard operation
sentry-java copied to clipboard

Allow to configure globalHubMode for SentryAppender from logback.xml

Open marbon87 opened this issue 1 year ago • 1 comments

Problem Statement

We have a java swing app, that uses logback for logging and the SentryAppender from sentry-logback. Sentry is configured in the logback.xml.

We need to enable globalHubMode, to get breadcrumbs across multiple threads. I didn't find a way to enable globalHubMode by using logback.xml. Only solution i found is to copy the content from SentryAppender#start()

Solution Brainstorm

Add the attribute globalHubMode in SentryAppender to get the possibilit of configuring globalHubMode from logback.xml

marbon87 avatar Oct 08 '24 17:10 marbon87

Hey @marbon87 we only provide a subset of config options directly via the XML config. The intended way for more complex config is to use sentry.properties (ExternalOptions) but it seems globalHubMode also isn't configurable there yet. We can add it so it's read from sentry.properties. The way this will work is shown in our logback sample.

adinauer avatar Oct 09 '24 09:10 adinauer

We have just released 8.0.0-beta.2 of the Java SDK, which allows configuring global-hub-mode through external options like sentry.properties. Happy to receive any feedback in case you decide to give it a try.

adinauer avatar Nov 13 '24 12:11 adinauer

Work's perfectly. Thank you @adinauer !

marbon87 avatar Nov 14 '24 15:11 marbon87

Thanks for the feedback!

adinauer avatar Nov 15 '24 08:11 adinauer