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

Missing toUpperCase(Locale.ENGLISH)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.2
    • Component/s: API
    • Labels:
    • Environment:

      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

            • Assignee:
              Unassigned
              Reporter:
              guleryuz fatih guleryuz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 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