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

Print configuration errors to stderr

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.8
    • Component/s: logback-core
    • Labels:
      None

      Description

      In org.slf4j.impl.StaticLoggerBinder#init(), any detected configuration errors are passed to StatusPrinter to be printed. However, the default PrintStream used by StatusPrinter is stdout, which can interfere with the output of command-line based Java programs that are used in the same fashion as applications such as ls or grep.

      Would it be possible to modify this behavior such that configuration errors are printed to stderr instead? A potential solution would be to overload StatusPrinter#printInCaseofErrorsOrWarning and StatusPrinter#printIfErrorsOccurred with versions that also take a PrintStream as an argument - this would allow classes like StaticLoggerBinder to specify the appropriate output stream without overriding the global state in StatusPrinter. Alternatively, an additional setting in the XML configuration might work just as well.

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              atomicknight Abraham Lin
            • Votes:
              3 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: