[
https://issues.apache.org/jira/browse/LOG4J2-1024?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14562452#comment-14562452
]
Patrick Zimmermann commented on LOG4J2-1024:
--------------------------------------------
Adding a display name solves the issue. I have attached the respective excerpts
(using the new code) with and without a display-name.
According to the XSD schema the display-name is optional. This is meant to work
even without a display-name given, is it?
without "display-name":
{quote}
DEBUG StatusLogger Log4jServletContainerInitializer starting up Log4j in
Servlet 3.0+ environment.
DEBUG StatusLogger Using the servlet context name "null".
ERROR StatusLogger No Log4j context configuration provided. This is very
unusual.
DEBUG StatusLogger Log4jServletContextListener ensuring that Log4j starts up
properly.
DEBUG StatusLogger Log4jServletFilter initialized.
DEBUG StatusLogger Using ShutdownCallbackRegistry class
org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
WARN StatusLogger Multiple logging implementations found:
Factory: org.apache.logging.log4j.core.impl.Log4jContextFactory, Weighting: 10
Using factory: org.apache.logging.log4j.core.impl.Log4jContextFactory
DEBUG StatusLogger Took 0.046317 seconds to load 140 plugins from
WebappClassLoader
context: /RemoteCalculation
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@19cee52
DEBUG StatusLogger PluginManager 'Converter' found 33 plugins
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT
DEBUG StatusLogger Starting LoggerContext[name=30633251,
org.apache.logging.log4j.core.LoggerContext@10ef717]...
DEBUG StatusLogger Reconfiguration started for context[name=30633251] at null
(org.apache.logging.log4j.core.LoggerContext@10ef717) with optional
ClassLoader: null
DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 3 plugins
DEBUG StatusLogger Missing dependencies for Yaml support
DEBUG StatusLogger Missing dependencies for Json support
DEBUG StatusLogger Using configurationFactory
org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@1a47cf7
ERROR StatusLogger No log4j2 configuration file found. Using default
configuration: logging only errors to the console.
DEBUG StatusLogger PluginManager 'Converter' found 33 plugins
DEBUG StatusLogger Starting configuration
org.apache.logging.log4j.core.config.DefaultConfiguration@83f05
DEBUG StatusLogger PluginManager 'Core' found 70 plugins
DEBUG StatusLogger PluginManager 'Level' found 0 plugins
DEBUG StatusLogger Started configuration
org.apache.logging.log4j.core.config.DefaultConfiguration@83f05 OK.
DEBUG StatusLogger Stopped
org.apache.logging.log4j.core.config.DefaultConfiguration@179ac74 OK
DEBUG StatusLogger Registering MBean org.apache.logging.log4j2:type=30633251
{quote}
with "display-name":
{quote}
DEBUG StatusLogger Log4jServletContainerInitializer starting up Log4j in
Servlet 3.0+ environment.
DEBUG StatusLogger Using the servlet context name "Remote Calculation".
DEBUG StatusLogger getConfigURI found resource paths [/WEB-INF/log4j2.xml] in
servletConext at [/WEB-INF/]
DEBUG StatusLogger getConfigURI found resource
[jndi:/localhost/RemoteCalculation/WEB-INF/log4j2.xml] in servletConext at
[/WEB-INF/log4j2.xml]
DEBUG StatusLogger Using ShutdownCallbackRegistry class
org.apache.logging.log4j.core.util.DefaultShutdownCallbackRegistry
WARN StatusLogger Multiple logging implementations found:
Factory: org.apache.logging.log4j.core.impl.Log4jContextFactory, Weighting: 10
Using factory: org.apache.logging.log4j.core.impl.Log4jContextFactory
DEBUG StatusLogger Took 0.045431 seconds to load 140 plugins from
WebappClassLoader
context: /RemoteCalculation
delegate: false
repositories:
/WEB-INF/classes/
----------> Parent Classloader:
org.apache.catalina.loader.StandardClassLoader@19cee52
DEBUG StatusLogger PluginManager 'Converter' found 33 plugins
DEBUG StatusLogger Starting OutputStreamManager SYSTEM_OUT
DEBUG StatusLogger PluginManager 'ConfigurationFactory' found 3 plugins
DEBUG StatusLogger Missing dependencies for Yaml support
DEBUG StatusLogger Missing dependencies for Json support
DEBUG StatusLogger Using configurationFactory
org.apache.logging.log4j.core.config.ConfigurationFactory$Factory@17a863d
{quote}
> log4j2.xml not found by default in WEB-INF folder
> -------------------------------------------------
>
> Key: LOG4J2-1024
> URL: https://issues.apache.org/jira/browse/LOG4J2-1024
> Project: Log4j 2
> Issue Type: Bug
> Components: Configurators
> Affects Versions: 2.3
> Environment: Tested on
> Windows 7 + Eclipse Juno + tomcat 7.0.62
> and
> CentOS 6.2 + tomcat 7.0.61
> Reporter: Patrick Zimmermann
> Priority: Minor
>
> I have a web application, included log4j-api-2.3, log4j-core-2.3 and
> log4j-web-2.3 and placed a log4j2.xml file in the WEB-INF folder.
> On application startup I receive the following message:
> ERROR StatusLogger No Log4j context configuration provided. This is very
> unusual.
> ERROR StatusLogger No log4j2 configuration file found. Using default
> configuration: logging only errors to the console.
> When I add
> <context-param>
> <param-name>log4jConfiguration</param-name>
> <param-value>/WEB-INF/log4j2.xml</param-value>
> </context-param>
> to my web.xml the error notification disappears.
> According to the documentation at
> http://logging.apache.org/log4j/2.x/manual/webapp.html Log4J2 should search a
> file starting with log4j2 in the WEB-INF folder if no context-param is
> specified.
> It seems, this does not happen.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]