You can configure your log4j file with a category tag (see console example):
<appender name="console" class="org.apache.log4j.ConsoleAppender"> <layout class="org.apache.log4j.PatternLayout"> <param name="ConversionPattern" value="%d{yy-MM-dd HH:mm:ss} %p %c - %m%n" /> </layout> </appender> <category name="org.hibernate"> <priority value="WARN" /> </category> <root> <priority value="INFO" /> <appender-ref ref="console" /> </root>
Thus, each warning, error message or fatal message from sleep mode will be displayed, nothing more. In addition, the code of the code and the library will be at the information level (so that information, warning, error and fatal)
To change the log level in the library, simply add a category, for example, to the deactivation spring info log:
<category name="org.springframework"> <priority value="WARN" /> </category>
Or with another addition, break additivity (the default value for additivity is true)
<category name="org.springframework" additivity="false"> <priority value="WARN" /> <appender-ref ref="anotherAppender" /> </category>
And if you do not want this hibernate to register every request, set the show_sql hibernate show_sql to false .
Emilien Brigand Oct 08 '13 at 14:07 2013-10-08 14:07
source share