logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remko Popma <remko.po...@gmail.com>
Subject Re: commons logging
Date Thu, 20 Feb 2014 23:36:29 GMT
Leos,

It looks correct to me...

Question: are the jar files all located in WEB-INF/lib (of the same war file that contains
WEB-INF/classes/log4j2.xml)?

Remko

Sent from my iPhone

> On 2014/02/21, at 7:10, Leos Literak <literakl@centrum.cz> wrote:
> 
>  
> Hi,
>  
> I have servlet with apache commons logging, and following jars:
>  
> commons-logging-1.1.3.jar json-smart-1.1.1.jar log4j-api-2.0-rc1.jar log4j-core-2.0-rc1.jar
log4j-jcl-2.0-rc1.jar
> 
> 
> 
> I have no LOG4J configuration in web.xml, but it prints during deployment in WildFly:
> 
> 
> 
> 22:48:01,336 INFO [io.undertow.servlet] (MSC service thread 1-11) Log4jServletContainerInitializer
starting up Log4j in Servlet 3.0+ environment.
> 
> 22:48:01,688 INFO [io.undertow.servlet] (MSC service thread 1-11) No Log4j context configuration
provided. This is very unusual.
> 
> 22:48:01,702 INFO [io.undertow.servlet] (MSC service thread 1-11) Log4jServletContextListener
ensuring that Log4j starts up properly.
> 
> 
> 
> The log4j2.xml is located in classes under WEB-INF:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <Configuration monitorInterval="30" strict="true">
> 
>  <!-- http://logging.apache.org/log4j/2.x/manual/configuration.html -->
> 
>  <Properties>
> 
>  <Property name="filename">c:/dev/oauth2.log</Property>
> 
>  </Properties>
> 
>  <Appenders>
> 
>  <Appender type="File" name="File" fileName="${filename}" immediateFlush="true">
> 
>  <Layout type="PatternLayout">
> 
>  <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
> 
>  <!--<PatternLayout pattern="%d{yyy-MM-dd HH:mm:ss.SSS} [%t] %-5level %logger{36}
- %msg%n"/>-->
> 
>  </Layout>
> 
>  </Appender>
> 
>  </Appenders>
> 
>  <Loggers>
> 
>  <Logger name="cz.literak.demo" level="debug" additivity="false">
> 
>  <AppenderRef ref="File"/>
> 
>  </Logger>
> 
>  <Root level="error">
> 
>  <AppenderRef ref="File"/>
> 
>  </Root>
> 
>  </Loggers>
> 
> </Configuration>
> 
> 
> 
> The file is created but it is empty. When I explicitelly created LOG4J Logger, then it
logs the statement to this file. But logging's Log does not work.
> 
> What is wrong?
> 
> 
> 
> Thanks
> 
> 
> 
> Leos
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org

Mime
  • Unnamed multipart/alternative (inline, 7-Bit, 0 bytes)
View raw message