You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Stephen Joyner (Jira)" <ji...@apache.org> on 2020/08/11 13:29:00 UTC
[jira] [Created] (LOG4J2-2906) Log4j2 Cloud Config Logging System
can't load config
Stephen Joyner created LOG4J2-2906:
--------------------------------------
Summary: Log4j2 Cloud Config Logging System can't load config
Key: LOG4J2-2906
URL: https://issues.apache.org/jira/browse/LOG4J2-2906
Project: Log4j 2
Issue Type: Bug
Components: Configuration
Affects Versions: 2.13.2
Reporter: Stephen Joyner
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.
{code:java}
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)
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)