Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1159

Don't swallow Errors

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.8
    • 1.1.6, 1.1.7
    • logback-classic
    • None

    Description

      I have a requirement to stop application requests in case the application cannot log for certain appenders. I've implemented this with a custom StatusListener that raises java.lang.Error for this.

      Starting from 1.1.7 this stopped working, because Logback catches Throwable (and not Exception) and Util.logs it and never rethrows Errors.

      Swallowing Errors is usually seen as a bad habit: http://pmd.sourceforge.net/pmd-4.3.0/rules/strictexception.html - as they signal severe errors which are not possible to handle.

      Pull request coming up - hope you accept it.

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            davidkarlsen David J. M. Karlsen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: