Uploaded image for project: 'JBoss Log Manager'
  1. JBoss Log Manager
  2. LOGMGR-325

Error message for an invalid log format should state what is invalid

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • core
    • None

      Reported upstream in Quarkus issue #33218:

      When I put this in application.properties:

      quarkus.log.console.format=%d{HH:mm:ss.SSS} %clr(${LOG_LEVEL_PATTERN:%5p}) %blue([%-15.15t]) %m%n
      

      I get an error message that lacks information:

      Caused by: java.lang.IllegalArgumentException: Encountered an unknown format character
              at org.jboss.logmanager.formatters.FormatStringParser.getSteps(FormatStringParser.java:204)
              at org.jboss.logmanager.formatters.PatternFormatter.setPattern(PatternFormatter.java:76)
      

      (...)

      The problem is in org.jboss.logmanager.formatters.FormatStringParser:

                          default: {
                              throw new IllegalArgumentException("Encountered an unknown format character");
                          }
      

      should be something like:

                          default: {
                              throw new IllegalArgumentException("Encountered an unknown format character (%" + formatChar  + ")");
                          }
      

              Unassigned Unassigned
              dlloyd@redhat.com David Lloyd
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: