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

SentryOptions on Logback and Log4j SentryAppender should not be used

Open adinauer opened this issue 2 years ago • 1 comments

Problem Statement

The SentryOptions options property on io.sentry.logback.SentryAppender should not be used except for the start method. It's set via the setOptions method by Logback. Then Logback calls start (its signature is specified by Logback).

This can cause problems when using the options property outside of the start method as options set via Sentry.init are ignored.

Solution Brainstorm

Put a warning in place as a first measure, not sure how to solve it for good.

adinauer avatar May 17 '22 07:05 adinauer

Very similar problem exists in io.sentry.log4j2.SentryAppender. There we don't store options but parts of the options like contextTags as field.

adinauer avatar May 18 '22 06:05 adinauer

Warning is in place and seems to suffice for now.

adinauer avatar Feb 07 '23 07:02 adinauer