You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Chen Levy (Jira)" <ji...@apache.org> on 2021/01/06 20:38:00 UTC
[jira] [Updated] (LOG4J2-2994) Setting configuration file path no
longer works with Windows OS
[ https://issues.apache.org/jira/browse/LOG4J2-2994?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chen Levy updated LOG4J2-2994:
------------------------------
Description:
Hello Everyone
Our project uses the following configuration when setting up Log4J2 with Tomcat:
{code:java}
-Dlog4j.configurationFile=$CATALINA_HOME/conf/log4j2.xml
{code}
This worked fine for many years now, but starting with version 2.13.2 we get the following exception on Windows machines:
{code:java}
ERROR StatusLogger Unable to access file://C/Work/Servers/apache-tomcat-9.0.40/conf/log4j2.xml
java.net.UnknownHostException: C
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
at java.base/java.net.Socket.connect(Socket.java:648)
at java.base/sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:961)
at java.base/sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:923)
at java.base/sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1018)
at java.base/sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1004)
at java.base/sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:319)
at java.base/sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:425)
at org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:338)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:507)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:500)
at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:423)
at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:323)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:691)
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:712)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:267)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:138)
at org.apache.logging.log4j.jul.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:34)
at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:48)
at org.apache.logging.log4j.jul.LogManager.getLogger(LogManager.java:96)
at java.logging/java.util.logging.LogManager.demandSystemLogger(LogManager.java:571)
at java.logging/java.util.logging.LogManager$LoggingProviderAccess.demandLoggerFor(LogManager.java:2710)
at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandJULLoggerFor(LoggingProviderImpl.java:411)
at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandLoggerFor(LoggingProviderImpl.java:436)
at java.base/jdk.internal.logger.DefaultLoggerFinder.getLogger(DefaultLoggerFinder.java:157)
at java.base/jdk.internal.logger.LazyLoggers.getLoggerFromFinder(LazyLoggers.java:389)
at java.base/jdk.internal.logger.LazyLoggers.getLazyLogger(LazyLoggers.java:444)
at java.base/jdk.internal.logger.LazyLoggers.getLogger(LazyLoggers.java:414)
at java.base/java.lang.System.getLogger(System.java:1679)
at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:890)
at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:599)
{code}
This prevents us from upgrading pass 2.13.1
Thanks
was:
Hello Everyone
Our project uses the following configuration when setting up Log4J2 with Tomcat:
{code:java}
-Dlog4j.configurationFile=$CATALINA_HOME/conf/log4j2.xml
{code}
This worked fine for many years now, but starting with version 2.13.2 we get the following exception on Windows machines:
{code:java}
ERROR StatusLogger Unable to access file://C/Work/Servers/apache-tomcat-9.0.40/conf/log4j2.xml
java.net.UnknownHostException: C
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
at java.base/java.net.Socket.connect(Socket.java:648)
at java.base/sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:961)
at java.base/sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:923)
{code}
This prevents us from upgrading pass 2.13.1
Thanks
> Setting configuration file path no longer works with Windows OS
> ---------------------------------------------------------------
>
> Key: LOG4J2-2994
> URL: https://issues.apache.org/jira/browse/LOG4J2-2994
> Project: Log4j 2
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 2.13.2, 2.14.0, 2.13.3
> Environment: Windows 10
> Tomcat 9.0.40
> AdoptOpenJDK 15.0.1
> Reporter: Chen Levy
> Priority: Major
>
> Hello Everyone
> Our project uses the following configuration when setting up Log4J2 with Tomcat:
> {code:java}
> -Dlog4j.configurationFile=$CATALINA_HOME/conf/log4j2.xml
> {code}
> This worked fine for many years now, but starting with version 2.13.2 we get the following exception on Windows machines:
> {code:java}
> ERROR StatusLogger Unable to access file://C/Work/Servers/apache-tomcat-9.0.40/conf/log4j2.xml
> java.net.UnknownHostException: C
> at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:567)
> at java.base/java.net.Socket.connect(Socket.java:648)
> at java.base/sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:961)
> at java.base/sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:923)
> at java.base/sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1018)
> at java.base/sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1004)
> at java.base/sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:319)
> at java.base/sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:425)
> at org.apache.logging.log4j.core.config.ConfigurationSource.fromUri(ConfigurationSource.java:338)
> at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:507)
> at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:500)
> at org.apache.logging.log4j.core.config.ConfigurationFactory$Factory.getConfiguration(ConfigurationFactory.java:423)
> at org.apache.logging.log4j.core.config.ConfigurationFactory.getConfiguration(ConfigurationFactory.java:323)
> at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:691)
> at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:712)
> at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:267)
> at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:155)
> at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:47)
> at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
> at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:138)
> at org.apache.logging.log4j.jul.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:34)
> at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:48)
> at org.apache.logging.log4j.jul.LogManager.getLogger(LogManager.java:96)
> at java.logging/java.util.logging.LogManager.demandSystemLogger(LogManager.java:571)
> at java.logging/java.util.logging.LogManager$LoggingProviderAccess.demandLoggerFor(LogManager.java:2710)
> at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandJULLoggerFor(LoggingProviderImpl.java:411)
> at java.logging/sun.util.logging.internal.LoggingProviderImpl.demandLoggerFor(LoggingProviderImpl.java:436)
> at java.base/jdk.internal.logger.DefaultLoggerFinder.getLogger(DefaultLoggerFinder.java:157)
> at java.base/jdk.internal.logger.LazyLoggers.getLoggerFromFinder(LazyLoggers.java:389)
> at java.base/jdk.internal.logger.LazyLoggers.getLazyLogger(LazyLoggers.java:444)
> at java.base/jdk.internal.logger.LazyLoggers.getLogger(LazyLoggers.java:414)
> at java.base/java.lang.System.getLogger(System.java:1679)
> at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.<clinit>(ConnectorBootstrap.java:890)
> at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
> at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:599)
> {code}
> This prevents us from upgrading pass 2.13.1
> Thanks
--
This message was sent by Atlassian Jira
(v8.3.4#803005)