Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-15628

SolrException.log doesn't pass Throwable to Logger correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 9.0, 8.11
    • None
    • None

    Description

      Having recently started using JSON based logging, I noticed that in many code paths situations where an error involving a "Throwable" are logged isn't happening correctly (This is also noticeable using the default solr log4j2.xml configuration - but only subtly)

      The problem is that SolrException.log(...) has some very old (pre Solr 1.0, certainly pre SLF4j/Log4j) and hackish logic/code in it to support SolrException.ignorePatterns (which was designed for tests that wanted "quieter" output when they were intentionally triggering error situations. This logic "stringifies" the entire Throwable (including stack trace) to test against any ignorePatterns that exist (even if there are no ignore patterns) before handing the resulting string off to the loggger.error(...) call – as a log message string - w/o the normal "structure" context of the original Throwable instance.

      This causes the full exception stack trace to come through as the log "message" – even in log appenders that have been configured to only log partial stack trace details, or log them in special fields (ie: JSON Logging)

      Attachments

        1. SOLR-15628.patch
          6 kB
          Chris M. Hostetter

        Issue Links

          Activity

            People

              hossman Chris M. Hostetter
              hossman Chris M. Hostetter
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: