Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force Jboss logging to use of SLF4J

I am using Hibernate 4.0 and Coldfusion 8 with Jrun which unfortunately has log4j already included and I can't remove it and the version of log4j is too old (no trace). Therefore Hibernate can't work. I would like to force Jboss Logging to use SLF4j for which I have added a binding to a custom log4j.

like image 526
Abbadon Avatar asked Feb 06 '13 16:02

Abbadon


People also ask

Does JBoss logger use log4j?

JBoss AS uses log4j as logging framework.

What logging does JBoss use?

To answer the question, JBoss Application Server 7. x, JBoss EAP and WildFly all use JBoss Logging for the logging facade and JBoss Log Manager for the log manager. You can use JBoss Logging, slf4j, JUL, log4j or commons logging for your facade.

How JBoss logging works?

Logging is controlled from a central conf/jboss-log4j. xml file. This file defines a set of appenders specifying the log files, what categories of messages should go there, the message format and the level of filtering. By default, JBoss produces output to both the console and a log file ( log/server.

Which hibernate logging dependency is required?

The jboss-logging jar is a required dependency of Hibernate and therefore will always need to be on the classpath.


1 Answers

I can't remember off the top of my head which version of JBoss Logging this was in, but try adding a system property of org.jboss.logging.provider=slf4j. Note though it will only work if you're using logback as well since SLF4J is only a facade like JBoss Logging not a log manager.

like image 154
James R. Perkins Avatar answered Oct 05 '22 22:10

James R. Perkins