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

Exception when using log4j2.properties and logger with dot

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.6
    • 2.6.1
    • None
    • None

    Description

      After upgrading log4j2 from 2.5 to 2.6 I get the following exception:

      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)

      The parameter "key" has the value "org" and the parameter properties has the value

      {activiti.engine.impl.level=info, activiti.engine.impl.name=org.activiti.engine.impl}

      The log4j2.properties in use:

      # 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
      

      Sadly I have not been able to reproduce the issue in a simple standalone application.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rgoers Ralph Goers
            pascal.schumacher@t-systems.com Pascal Schumacher
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment