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

Log4j2 Cloud Config Logging System can't load config

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.13.2
    • 2.14.0
    • Configuration
    • None

    Description

      When the Log4j2CloudConfigLoggingSystem class runs the getStandardConfigLocations() method, if the log4j.configurationFile property is set, a StackTrace will be thrown. This happens because Arrays.asList() is used to convert the String[] to a list, but the list that is returned cannot be modified using any methods that would change the size of the array.

      Exception in thread "Thread-18" java.lang.UnsupportedOperationExceptionException in thread "Thread-18" java.lang.UnsupportedOperationException at java.util.AbstractList.add(AbstractList.java:148) at java.util.AbstractList.add(AbstractList.java:108) at org.apache.logging.log4j.spring.cloud.config.client.Log4j2CloudConfigLoggingSystem.getStandardConfigLocations(Log4j2CloudConfigLoggingSystem.java:92) at org.springframework.boot.logging.AbstractLoggingSystem.getSelfInitializationConfig(AbstractLoggingSystem.java:93) at org.springframework.boot.logging.AbstractLoggingSystem.initializeWithConventions(AbstractLoggingSystem.java:70) at org.springframework.boot.logging.AbstractLoggingSystem.initialize(AbstractLoggingSystem.java:60) at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.initialize(Log4J2LoggingSystem.java:144) at org.apache.logging.log4j.spring.cloud.config.client.Log4j2CloudConfigLoggingSystem.initialize(Log4j2CloudConfigLoggingSystem.java:82) at org.springframework.boot.context.logging.LoggingApplicationListener.initializeSystem(LoggingApplicationListener.java:289) at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:264) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:226) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:203) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:76) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:342) at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sjoyner-rd Stephen Joyner
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: