Uploaded image for project: 'JBoss Logging'
  1. JBoss Logging
  2. JBLOGGING-140

Avoid ClassCastException in Slf4jLoggerProvider

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • 3.4.1.Final
    • None
    • None
    • None

      We use jboss-logging with a custom SLF4J implementation that does not implement LocationAwareLogger. We have exception tracing on and see a ClassCastException in org.jboss.logging.Slf4jLoggerProvider#getLogger(String) for every logger we look up.

      We did some preliminary microbenchmarks and can see no differences between unconditionally casting and catching Throwable vs an instanceof, both in cases where the check succeeds and where is fails. Having said the class hierarchies we tested are slightly different from actual SLF4J class hierarchies.

              jperkins-rhn James Perkins
              pmarscha Philippe Marschall (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: