Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-529

Platform Logging bridge should use MessageFormat but it's using String.format

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 2.0.9
    • 2.0.0-alpha5
    • Unspecified
    • None
    •  

    Description

      java.lang.System.Logger.log is specified to accept the message format of MessageFormat. However, the current SLF4JPlatformLogger implementation uses String.format instead of MessageFormat. As a result, the current implementation cannot format the message correctly.

      Expected and actual behavior

      LoggerFinder finder = System.LoggerFinder.getLoggerFinder();
      Logger systemLogger = finder.getLogger("smoke", null);
      systemLogger.log(Level.INFO, "hello {0}", "world");
      

       
      Expected output:

      INFO smoke - hello world
      

      Actual output:

      INFO smoke - hello {0}
      

       

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            miyakawataku Taku Miyakawa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: