Lokesh Paunikar
Lokesh Paunikar

Reputation: 1709

avoid hibernate logs from printing on jboss console

I m using jboss as application server, it very irritating when I am deploy my application on jboss server it printing hibernate logs like

"FINE: ----- beginning hibernate tx 32213345 --------------------------------------------------------
16:37:27,716 ERROR [STDERR] 6 Dec, 2010 4:37:27 PM org.jbpm.internal.log.Jdk14Log info
INFO: jBPM version info: library[4.3], schema[4.3]
16:37:27,717 ERROR [STDERR] 6 Dec, 2010 4:37:27 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- committing hibernate tx 22527471 -------------------------------------------------------
16:37:27,719 INFO  [STDOUT] 16:37:27,719 INFO  [ProcessExecutionFactory] Exiting ServiceExecutionIntf with return value .....null(org.jbpm.test.ProcessExecutionProviderImpl)
16:37:27,762 ERROR [STDERR] 6 Dec, 2010 4:37:27 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- beginning hibernate tx 19486230 --------------------------------------------------------
16:37:27,921 ERROR [STDERR] 6 Dec, 2010 4:37:27 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- committing hibernate tx 2165098 -------------------------------------------------------
16:37:27,926 ERROR [STDERR] 6 Dec, 2010 4:37:27 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- beginning hibernate tx 26648124 --------------------------------------------------------
16:37:28,001 ERROR [STDERR] 6 Dec, 2010 4:37:28 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- committing hibernate tx 9901286 -------------------------------------------------------
16:37:28,018 ERROR [STDERR] 6 Dec, 2010 4:37:28 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- beginning hibernate tx 11762369 --------------------------------------------------------
16:37:28,185 ERROR [STDERR] 6 Dec, 2010 4:37:28 PM org.jbpm.internal.log.Jdk14Log debug
FINE: ----- committing hibernate tx 7629906 -------------------------------------------------------
"

So, is any way to avoid it from printing on jboss server? If so, then plz. r'ply me as soon as possible.

thank you.

Upvotes: 0

Views: 1804

Answers (2)

Jinesh Parekh
Jinesh Parekh

Reputation: 2141

Add a new file appender in log4j.properties file (create a new one if you dont have it) and do something like below to make those logs go into a seperate file of its own.

log4j.logger.org.hibernate.SQL=SQL_APPENDER

Upvotes: 0

kraftan
kraftan

Reputation: 6312

First of all, there is a problem with your log configuration. Is there any information in your JBoss log that it wasn't able to open the log file?

Apart from that issue, JBoss configures the log output per instance. You can find the configuration file in, e.g., for the default instance, $JBOSS_HOME/server/default/conf/jboss-log4j.xml. Inside this file you find a general section about Hibernate. For example:

<!-- Limit the verbose hibernate categories -->
<category name="org.hibernate">
   <priority value="INFO" />
</category>

I assume, in your file INFO is replaced by DEBUG. So, switch back to INFO or a more higher level, such as WARN or ERROR.

Hope that helps.

Upvotes: 2

Related Questions