logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-409) Specifying log4jConfiguration in web.xml fails on Windows when using ${user.home}
Date Fri, 22 Nov 2013 01:29:37 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13829550#comment-13829550
] 

Gary Gregory commented on LOG4J2-409:
-------------------------------------

Thomas' patch looks good. I agree that a patch should not generically fiddle with all properties,
only in code that will end up as a URIs. This means there might be more than one place to
change in the code...


> Specifying log4jConfiguration in web.xml fails on Windows when using ${user.home}
> ---------------------------------------------------------------------------------
>
>                 Key: LOG4J2-409
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-409
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.0-beta8
>         Environment: Windows 7, Apache Tomcat 7, Java 7
>            Reporter: Frank Steinmann
>         Attachments: LOG4J2-409.patch
>
>
> When specifying the context parameter log4jConfiguration in the web.xml of a web application
and using $\{user.home\} as part of the path, e.g.
> {code:xml}
> <context-param>
>     <param-name>log4jConfiguration</param-name>
>     <param-value>file://${user.home}/someDirectory/log4j2.xml</param-value>
> </context-param>
> {code}
> the following exception is thrown on Windows systems:
> {noformat}
> java.net.URISyntaxException: Illegal character in authority at index 7: file://C:\Users\steinman/someDirectory/log4j2.xml
>     at java.net.URI$Parser.fail(Unknown Source)
>     at java.net.URI$Parser.parseAuthority(Unknown Source)
>     at java.net.URI$Parser.parseHierarchical(Unknown Source)
>     at java.net.URI$Parser.parse(Unknown Source)
>     at java.net.URI.<init>(Unknown Source)
>     at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:46)
>     ...
> {noformat}
> It is because of the backslashes that are not allowed in URIs.
> There is an example in the documentation using backslashes ([http://logging.apache.org/log4j/2.x/manual/webapp.html])
which will produce the same exception.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message