[
https://issues.apache.org/jira/browse/LOG4J2-873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14909463#comment-14909463
]
Laszlo Csaba Lorincz commented on LOG4J2-873:
---------------------------------------------
The **missing display-name** is causing problems also with **Spring Boot**
applications with **no web.xml** (current GA: 1.2.6.RELEASE).
Log4jServletContainerInitializer is called before any of the
SpringBootServletInitializer / WebApplicationInitializer instances, thus no
programmatic initialization is possible.
(Spring Boot 1.3+ might solve this by introducing the server.display-name
property, but it's not production ready yet.)
> WebLookup shouldn't require display-name element in web.xml
> -----------------------------------------------------------
>
> Key: LOG4J2-873
> URL: https://issues.apache.org/jira/browse/LOG4J2-873
> Project: Log4j 2
> Issue Type: Bug
> Components: Web/Servlet
> Affects Versions: 2.0.2
> Reporter: Martin Dickins
> Priority: Minor
>
> The initializeNonJndi method in Log4jWebInitializerImpl uses
> servletContext.getServletContextName() to get a context name (if the name
> hasn't been defined using log4jContextName). getServletContextName() returns
> the name as specified in the <display-name> element in web.xml, but that is
> optional.
> If neither <display-name> nor log4jContextName is defined, this results in
> the servletContext not being set, so the WebLookup doesn't work.
> It should use some sort of default. Probably the name of the war file or
> context file, if there's a generic way of getting that.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]