File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
sentry-log4j2/src/main/java/io/sentry/log4j2 Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -277,11 +277,13 @@ protected void captureLog(@NotNull LogEvent loggingEvent) {
277277 event .setExtra ("marker" , loggingEvent .getMarker ().toString ());
278278 }
279279
280- final Map <String , String > contextData = loggingEvent .getContextData ().toMap ();
281- if (contextData != null ) {
280+ final Map <String , String > contextData =
281+ CollectionUtils .filterMapEntries (
282+ loggingEvent .getContextData ().toMap (), entry -> entry .getValue () != null );
283+ if (!contextData .isEmpty ()) {
282284 // get tags from ScopesAdapter options to allow getting the correct tags if Sentry has been
283285 // initialized somewhere else
284- final @ NotNull List <String > contextTags = scopes .getOptions ().getContextTags ();
286+ final List <String > contextTags = scopes .getOptions ().getContextTags ();
285287 LoggerPropertiesUtil .applyPropertiesToEvent (event , contextTags , contextData );
286288 // put the rest of mdc tags in contexts
287289 if (!contextData .isEmpty ()) {
You can’t perform that action at this time.
0 commit comments