You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2016/06/01 15:58:59 UTC
[jira] [Commented] (LOG4J2-1402)
org.apache.logging.log4j.core.config.ConfigurationException: No name
attribute provided for Logger org
[ https://issues.apache.org/jira/browse/LOG4J2-1402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15310532#comment-15310532 ]
Gary Gregory commented on LOG4J2-1402:
--------------------------------------
Hm, the root logger name is the empty string, so it sounds like we need a special case for that.
> org.apache.logging.log4j.core.config.ConfigurationException: No name attribute provided for Logger org
> ------------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-1402
> URL: https://issues.apache.org/jira/browse/LOG4J2-1402
> Project: Log4j 2
> Issue Type: Bug
> Components: JCL Bridge
> Affects Versions: 2.6
> Reporter: Pascal Schumacher
>
> After upgrading log4j2 from 2.5 to 2.6 I get the following exception:
> {quote}
> Exception in thread "main" org.apache.logging.log4j.core.config.ConfigurationException: No name attribute provided for Logger org
> at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.createLogger(PropertiesConfigurationBuilder.java:215)
> at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationBuilder.build(PropertiesConfigurationBuilder.java:140)
> at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.getConfiguration(PropertiesConfigurationFactory.java:52)
> at org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.getConfiguration(PropertiesConfigurationFactory.java:34)
> at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:510)
> at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:450)
> at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:257)
> at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:560)
> at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:577)
> at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:212)
> at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152)
> at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45)
> at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
> at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103)
> at org.apache.logging.log4j.jcl.LogAdapter.getContext(LogAdapter.java:39)
> at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42)
> at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
> at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
> at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:159)
> at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:223)
> at org.springframework.context.support.AbstractRefreshableApplicationContext.<init>(AbstractRefreshableApplicationContext.java:88)
> at org.springframework.context.support.AbstractRefreshableConfigApplicationContext.<init>(AbstractRefreshableConfigApplicationContext.java:58)
> at org.springframework.context.support.AbstractXmlApplicationContext.<init>(AbstractXmlApplicationContext.java:61)
> at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:136)
> at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
> x.y.z.Start.main(Start.java:12)
> {quote}
> The parameter "key" has the value "org" and the parameter properties has the value {code}{activiti.engine.impl.level=info, activiti.engine.impl.name=org.activiti.engine.impl}{code}.
> The log4j2.properties in use:
> {code}
> # Root logger option
> rootLogger.level = info
> rootLogger.appenderRefs = stdout
> rootLogger.appenderRef.stdout.ref = STDOUT
> # Redirect log messages to console
> appenders = stdout
> appender.stdout.type = Console
> appender.stdout.name = STDOUT
> appender.stdout.layout.type = PatternLayout
> appender.stdout.layout.pattern = %d %-5p [%t] %c - %m%n
> {code}
> I tried using a simple log4j2.xml instead, but that does not seem to help
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="WARN">
> <Appenders>
> <Console name="Console" target="SYSTEM_OUT">
> <PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} - %msg%n" />
> </Console>
> </Appenders>
> <Loggers>
> <Root level="info">
> <AppenderRef ref="Console" />
> </Root>
> </Loggers>
> </Configuration>
> {code}
> Sadly I have not been able to reproduce the issue in a simple standalone application.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org