Log4j 2
  1. Log4j 2
  2. LOG4J2-704

-Dlog4j.configurationFile no longer accepts relative paths

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-rc2
    • Fix Version/s: 2.0.1
    • Component/s: Configurators
    • Labels:
      None
    • Environment:

      Ubuntu. Oracle Java 1.7.

      Description

      I just upgraded from beta9 to rc2 and my command line applications now fail on startup.

      I am passing -Dlog4j.configurationFile=conf/log4j2.xml

      The documentation does not state that relative paths are no longer supported but the error indicates that only absolute paths can now be used.

      [java] ERROR StatusLogger Unable to access conf/log4j2.xml java.lang.IllegalArgumentException: URI is not absolute
      [java] at java.net.URI.toURL(URI.java:1095)
      [java] at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFromUri(ConfigurationFactory.java:265)
      [java] at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:382)
      [java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:415)
      [java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:146)
      [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:75)
      [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:37)
      [java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:268)
      [java] at org.apache.logging.slf4j.Log4jLoggerFactory$PrivateManager.getContext(Log4jLoggerFactory.java:98)
      [java] at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:84)
      [java] at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:44)
      [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
      [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)

        Activity

        Remko Popma made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 2.0.1 [ 12327381 ]
        Resolution Fixed [ 1 ]
        Remko Popma made changes -
        Assignee Remko Popma [ remkop@yahoo.com ]
        Andy Grove made changes -
        Description I just upgraded from beta9 to rc2 and my command line applications now fail on startup.

        I am passing -Dlog4j.configurationFile=conf/log4j2.xml

        The documentation does not state that relative paths are no longer supported but the error indicates that only absolute paths can now be used.

        ] ERROR StatusLogger Unable to access conf/log4j2.xml java.lang.IllegalArgumentException: URI is not absolute
             [java] at java.net.URI.toURL(URI.java:1095)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFromURI(ConfigurationFactory.java:258)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:374)
             [java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:385)
             [java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:149)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:84)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:35)
             [java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:257)
             [java] at org.slf4j.helpers.Log4jLoggerFactory$PrivateManager.getContext(Log4jLoggerFactory.java:104)
             [java] at org.slf4j.helpers.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:90)
             [java] at org.slf4j.helpers.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:46)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        I just upgraded from beta9 to rc2 and my command line applications now fail on startup.

        I am passing -Dlog4j.configurationFile=conf/log4j2.xml

        The documentation does not state that relative paths are no longer supported but the error indicates that only absolute paths can now be used.

             [java] ERROR StatusLogger Unable to access conf/log4j2.xml java.lang.IllegalArgumentException: URI is not absolute
             [java] at java.net.URI.toURL(URI.java:1095)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFromUri(ConfigurationFactory.java:265)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:382)
             [java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:415)
             [java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:146)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:75)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:37)
             [java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:268)
             [java] at org.apache.logging.slf4j.Log4jLoggerFactory$PrivateManager.getContext(Log4jLoggerFactory.java:98)
             [java] at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:84)
             [java] at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:44)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)

        Gary Gregory made changes -
        Comment [ That does NOT look like a 2.0-rc2 stack trace.

        {{ConfigurationFactory.getInputFromURI()}} was renamed to {{ConfigurationFactory.getInputFromUri()}} before rc2.

        Verify your classpath and try again. ]
        Andy Grove made changes -
        Field Original Value New Value
        Description I just upgraded from beta9 to rc2 and my command line applications now fail on startup.

        I am passing -Dlog4.configurationFile=conf/log4j2.xml

        The documentation does not state that relative paths are no longer supported but the error indicates that only absolute paths can now be used.

        ] ERROR StatusLogger Unable to access conf/log4j2.xml java.lang.IllegalArgumentException: URI is not absolute
             [java] at java.net.URI.toURL(URI.java:1095)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFromURI(ConfigurationFactory.java:258)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:374)
             [java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:385)
             [java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:149)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:84)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:35)
             [java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:257)
             [java] at org.slf4j.helpers.Log4jLoggerFactory$PrivateManager.getContext(Log4jLoggerFactory.java:104)
             [java] at org.slf4j.helpers.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:90)
             [java] at org.slf4j.helpers.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:46)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        I just upgraded from beta9 to rc2 and my command line applications now fail on startup.

        I am passing -Dlog4j.configurationFile=conf/log4j2.xml

        The documentation does not state that relative paths are no longer supported but the error indicates that only absolute paths can now be used.

        ] ERROR StatusLogger Unable to access conf/log4j2.xml java.lang.IllegalArgumentException: URI is not absolute
             [java] at java.net.URI.toURL(URI.java:1095)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory.getInputFromURI(ConfigurationFactory.java:258)
             [java] at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:374)
             [java] at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:385)
             [java] at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:149)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:84)
             [java] at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:35)
             [java] at org.apache.logging.log4j.LogManager.getContext(LogManager.java:257)
             [java] at org.slf4j.helpers.Log4jLoggerFactory$PrivateManager.getContext(Log4jLoggerFactory.java:104)
             [java] at org.slf4j.helpers.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:90)
             [java] at org.slf4j.helpers.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:46)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:270)
             [java] at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:281)
        Andy Grove created issue -

          People

          • Assignee:
            Remko Popma
            Reporter:
            Andy Grove
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development