Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-2953

Remove support for logging to JUL (java.util.logging)



    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.8.1
    • Fix Version/s: 4.0.0
    • Component/s: Monitoring
    • Labels:
    • Environment:
      OSGI DS, ch.qos.logback.classic fragment implementation, Eclipse IDE, Java 1.8.0_181, Java Driver 3.8
    • Backwards Compatibility:
      Minor Change


      Remove direct support for JUL in the 4.x driver, making SLF4J the only way for the driver to log.  Applications requiring JUL logging must use the SFL4J-JUL bridge library.

      If SLF4J is not detected, the driver will log a single message to JUL indicating that logging is disabled.

      Original Description

      I am working on an OSGI DS project that implements an OSGI fragment with ch.qos.logback.classic to attach to slf4j. Because I am using slf4j, the driver uses it for its default logging unless I override it by setting the logger level to OFF in the code base. However, even with this, the driver continues to use com.mongodb.diagnostics.logging.JULLogger, java.util.logging.Logger, as a fallback. The driver should not force an application to output its logging but rather some configuration or programmatic setting should be added to prevent any logging to the console.

      I would think at least a public interface to the JULLoger or diagnostics.




            • Votes:
              0 Vote for this issue
              4 Start watching this issue


              • Created: