@@ -448,14 +448,10 @@ private static boolean supportsMultipleMarkers() {
448448
449449 private static void captureLogstashAttributes (
450450 AttributesBuilder attributes , ILoggingEvent loggingEvent ) {
451- try {
452- if (supportsMultipleMarkers && hasMultipleMarkers (loggingEvent )) {
453- captureMultipleLogstashAttributes (attributes , loggingEvent );
454- } else {
455- captureSingleLogstashAttribute (attributes , loggingEvent );
456- }
457- } catch (Throwable e ) {
458- // ignore
451+ if (supportsMultipleMarkers && hasMultipleMarkers (loggingEvent )) {
452+ captureMultipleLogstashAttributes (attributes , loggingEvent );
453+ } else {
454+ captureSingleLogstashAttribute (attributes , loggingEvent );
459455 }
460456 }
461457
@@ -465,13 +461,11 @@ private static boolean isLogstashMarker(Marker marker) {
465461 }
466462
467463 @ SuppressWarnings ("deprecation" ) // getMarker is deprecate since 1.3.0
468- @ NoMuzzle
469464 private static void captureSingleLogstashAttribute (
470465 AttributesBuilder attributes , ILoggingEvent loggingEvent ) {
471466 Marker marker = loggingEvent .getMarker ();
472467 if (isLogstashMarker (marker )) {
473- LogstashMarker logstashMarker = (LogstashMarker ) marker ;
474- captureLogstashMarker (attributes , logstashMarker );
468+ captureLogstashMarker (attributes , marker );
475469 }
476470 }
477471
@@ -480,31 +474,28 @@ private static void captureMultipleLogstashAttributes(
480474 AttributesBuilder attributes , ILoggingEvent loggingEvent ) {
481475 for (Marker marker : loggingEvent .getMarkerList ()) {
482476 if (isLogstashMarker (marker )) {
483- LogstashMarker logstashMarker = (LogstashMarker ) marker ;
484- captureLogstashMarker (attributes , logstashMarker );
477+ captureLogstashMarker (attributes , marker );
485478 }
486479 }
487480 }
488481
489482 @ NoMuzzle
490- private static void captureLogstashMarker (
491- AttributesBuilder attributes , LogstashMarker logstashMarker ) {
483+ private static void captureLogstashMarker (AttributesBuilder attributes , Marker marker ) {
484+ LogstashMarker logstashMarker = ( LogstashMarker ) marker ;
492485 captureLogstashMarkerAttributes (attributes , logstashMarker );
493486
494487 if (logstashMarker .hasReferences ()) {
495488 for (Iterator <Marker > it = logstashMarker .iterator (); it .hasNext (); ) {
496489 Marker referenceMarker = it .next ();
497490 if (isLogstashMarker (referenceMarker )) {
498- LogstashMarker referenceLogstashMarker = (LogstashMarker ) referenceMarker ;
499- captureLogstashMarker (attributes , referenceLogstashMarker );
491+ captureLogstashMarker (attributes , referenceMarker );
500492 }
501493 }
502494 }
503495 }
504496
505- @ NoMuzzle
506497 private static void captureLogstashMarkerAttributes (
507- AttributesBuilder attributes , LogstashMarker logstashMarker ) {
498+ AttributesBuilder attributes , Object logstashMarker ) {
508499 FieldReader fieldReader = valueField .get (logstashMarker .getClass ());
509500 if (fieldReader != null ) {
510501 fieldReader .read (attributes , logstashMarker );
@@ -608,7 +599,7 @@ private static boolean supportsLogstashMarkers() {
608599 }
609600
610601 private interface FieldReader {
611- void read (AttributesBuilder attributes , LogstashMarker logstashMarker );
602+ void read (AttributesBuilder attributes , Object logstashMarker );
612603 }
613604
614605 /**
0 commit comments