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

Exception in Log4j2CloudConfigLoggingSystem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.13.3
    • None
    • Spring
    • None
    • This code was called in dockerized springboot application so environment recreating is not easy, but error seems to be pretty obvious.

    Description

      Exception is thrown at line 92 of class Log4j2CloudConfigLoggingSystem.

      Reason is pretty simple:

              String location = props.getStringProperty(ConfigurationFactory.CONFIGURATION_FILE_PROPERTY);
              if (location != null) {
                  List<String> list = Arrays.asList(super.getStandardConfigLocations());
                  list.add(location);
                  locations = list.toArray(new String[0]);
              }
      

      Method Arrays.asList() returns fixed size list, so the next line call list.add(location); causes exception:

      java.lang.UnsupportedOperationException: null
      at java.util.AbstractList.add(AbstractList.java:148) ~[?:1.8.0_265]
      at java.util.AbstractList.add(AbstractList.java:108) ~[?:1.8.0_265]
      at org.apache.logging.log4j.spring.cloud.config.client.Log4j2CloudConfigLoggingSystem.getStandardConfigLocations(Log4j2CloudConfigLoggingSystem.java:92) ~[log4j-spring-cloud-config-client-2.13.3.jar:2.13.3]

      Attachments

        Activity

          People

            Unassigned Unassigned
            raffig RafaƂ Figas
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: