Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25494

Redirect the java.util.logging logs to SLF4J

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Major
    • 18.10.0-rc-1
    • 17.10.14
    • Logging
    • None
    • Unknown

    Description

      Some libraries used by XWiki log through java.util.logging (JUL), for example Lucene (used by the embedded Solr). Contrary to the logs of the other logging APIs (JCL, Log4j 1 and Log4j 2 are already redirected to SLF4J), those logs don't go through SLF4J and Logback: they are printed directly by the JUL handlers of the JVM or the servlet container, with their own format, and they cannot be configured in logback.xml (see for example XWIKI-22012 and XWIKI-25453).

      Proposal:

      • Install SLF4J's SLF4JBridgeHandler (org.slf4j:jul-to-slf4j) when the XWiki webapp starts, in place of the existing handlers of the JUL root logger (to avoid displaying the messages twice), and put things back when the webapp stops.
      • Add Logback's LevelChangePropagator to the logback.xml of the WAR, so that the levels of the JUL loggers follow the Logback configuration (otherwise JUL creates log records even for the levels disabled in Logback).

      Attachments

        Issue Links

          Activity

            People

              tmortagne Thomas Mortagne
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: