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

Warn when no StatusListener is defined

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • logback-core
    • None

    Description

      I recently had a problem where a non-trivial error was logged to the StatusManager, but no StatusListener was defined.

      StaticLoggerBinder does have a:

            if(!StatusUtil.contextHasStatusListener(defaultLoggerContext)) {
              StatusPrinter.printInCaseOfErrorsOrWarnings(defaultLoggerContext);
            }
      

      but this didn't help because the warning occurred after this point.

      I think it would be useful to log a warning when no StatusListener is registered. Users who really really don't want a StatusListener could register a 'NoopStatusListener' or something similar.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            raboof Arnout Engelen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: