vikneswar_me5 wrote:
hi,
can we forcing hibernate log inot the seperate log file using log4j instead of writing jboss server?
plz let me know..
Regards,
viknes
Yes you can. Define a new file appender in log4j config file:
Code:
<appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/hibernate.log"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="500KB"/>
<param name="MaxBackupIndex" value="1"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d %-5p [%c] %m%n"/>
</layout>
</appender>
and then configure hibernate logger to write to this file:
Code:
<category name="org.hibernate" additivity="false">
<priority value="debug"/>
<appender-ref ref="FILE"/>
</category>
I hope this helps.
Farzad-