logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leos Literak <liter...@centrum.cz>
Subject commons logging
Date Thu, 20 Feb 2014 22:10:53 GMT
 
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



Mime
View raw message