You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Henry Clout (JIRA)" <ji...@apache.org> on 2013/03/05 17:21:11 UTC

[jira] [Resolved] (LOG4J2-172) Logging doesn't work in Hibernate

     [ https://issues.apache.org/jira/browse/LOG4J2-172?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Henry Clout resolved LOG4J2-172.
--------------------------------

    Resolution: Not A Problem
    
> Logging doesn't work in Hibernate
> ---------------------------------
>
>                 Key: LOG4J2-172
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-172
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: SLF4J Bridge
>    Affects Versions: 2.0-beta4
>         Environment: OSX, Tomcat 6, Spring, Hibernate
>            Reporter: Henry Clout
>              Labels: hibernate, slf4j
>
> I've been testing a migration from log4j1.x to log4j 2.0 beta 4.  So far I've got our application and Spring logging fine using log4j2, but I can't seem to get any output from Hibernate (4).  Hibernate uses slf4j, so I've included the bridge, but alas no go.
> I've included the following jars :
> log4j-api-2.0-beta4.jar
> log4j-core-2.0-beta4.jar
> log4j-slf4j-impl-2.0-beta4.jar
> slf4j-api-1.7.2.jar
> slf4j-ext-1.7.2.jar
> My log4j2.xml is as follows:
> <?xml version="1.0" encoding="UTF-8" ?>
> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/' monitorInterval="5" status="debug">
>   <appenders>
>   
>     <Console name="STANDARD_CONSOLE" target="SYSTEM_OUT">
>       <PatternLayout pattern="%d [%t] %-5p %20c{1}.%M - %m%n"/>
>     </Console>
>   
>     <RollingFile name="FILE_APPENDER" fileName="/Users/henry/Documents/kulu/tools/logs/server.log"
>     								  filePattern="/Users/henry/Documents/kulu/tools/logs/server-%i.log">
>       <PatternLayout>
>         <pattern>%d [%t] %-5p %20c{1}.%M - %m%n</pattern>
>       </PatternLayout>
>       <Policies>
>         <SizeBasedTriggeringPolicy size="500000 KB"/>
>       </Policies>
>       <DefaultRolloverStrategy max="5"/>
>     </RollingFile>
>     <SMTP name="EMAIL_APPENDER" suppressExceptions="false" subject="[KVP] %c{1}: %m" to="henry.clout@kuluvalley.com"
>       from="no_reply@kuluvalley.com" smtpHost="mail.kuluvalley.com" smtpUsername="henry.clout@kuluvalley.com"
>       smtpPassword="pw" bufferSize="10">
>       
>        <BurstFilter rate="0.1" />
>     </SMTP>
>   </appenders>
>   <loggers>
> 	<logger name="com.kuluvalley" level="warn">
> 		<appender-ref ref="FILE_APPENDER" />
> 		<appender-ref ref="STANDARD_CONSOLE" />
> 	</logger>
> 	<logger name="com.kuluvalley.guru.server.service.common.PackageServiceImpl" level="info">
> 		<appender-ref ref="FILE_APPENDER" />
> 	</logger>
> 	<logger name="org.springframework" level="warn">
> 		<appender-ref ref="FILE_APPENDER" />
> 	</logger>
> 	<logger name="org.springframework.security" level="warn">
> 		<appender-ref ref="FILE_APPENDER" />
> 	</logger>
> 	<logger name="org.apache.cxf" level="info">
> 		<appender-ref ref="FILE_APPENDER" />
> 	</logger>
> 	<logger name="org.hibernate" level="debug">
> 		<appender-ref ref="FILE_APPENDER" />
> 		<appender-ref ref="STANDARD_CONSOLE" />
> 	</logger>
> 	<logger name="org.hibernate.SQL" level="debug">
> 		<appender-ref ref="FILE_APPENDER" />
> 		<appender-ref ref="STANDARD_CONSOLE" />
> 	</logger>
> 	<root level="info">
> 		<appender-ref ref="FILE_APPENDER" />
> 	</root> 
> 	
>   </loggers>
> </log4j:configuration>
> Any thoughts as to what could be wrong?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

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