Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-957

Missing toUpperCase(Locale.ENGLISH)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.1
    • 2.2
    • API
    • turkish locale, redhat, websphere

    Description

      setting level of logger as "info" in log4j2-cnfig.xml, whene initializing logger produces such an exception

      WARN Error while converting string [info] to type [class org.apache.logging.log4j.Level]. Using default value [null]. java.lang.IllegalArgumentException: Unknown level constant [─░NFO].

      when i look at source the problem appears to be a forgotten Locale.ENGLISH in toUpperCase method

      class:
      org.apache.logging.log4j.Level
      method:
      public static Level valueOf(final String name) {
      if (name == null)

      { throw new NullPointerException("No level name given."); }

      final String levelName = name.toUpperCase();
      if (levels.containsKey(levelName))

      { return levels.get(levelName); }

      throw new IllegalArgumentException("Unknown level constant [" + levelName + "].");
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            guleryuz fatih guleryuz
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified