Hibernate Logging

takki

Grünschnabel
Hallo,
ich habe mal wieder ein kleineres Problem mit meinem Programm.
Und zwar greife ich mit Hibernate auf eine Datenbank zu. Nun stören mich jedoch die vielen Status und Info-Meldungen die Hibernate so über System.err ausspuckt, darum würde ich diese gerne deaktivieren oder bei Bedarf in eine Datei umleiten.
Ich meine damit lediglich die Info-Ausgaben, wie zum Beispiel:
Code:
INFO: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
27.07.2009 14:21:23 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
27.07.2009 14:21:23 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
27.07.2009 14:21:23 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled

In der Hibernate-Doku steht das Hibernate SLF4J zum Logging benutzt. Auf diversen Webseiten, sowie der Doku zu SLF4J wird erwähnt das man lediglich das Packet slf4j-nop-1.5.8.jar mit einbinden braucht um das Logging komplett zu deaktivieren.
Gesagt getan, doch das Logging findet weiterhin statt.
Was mich stutzig macht, ist die Tatsache das ich "slf4j-api.jar" gar nicht zum Projekt linken muss und das Logging trotzdem stattfindet. Ich hätte eigentlich erwartet das das Programm dann crasht, weil er die Logging-Klassen nicht findet, da ja Hibernate angeblich SLF4J benutzt?!

Mein Projekt hat leider sehr viele Abhängigkeiten, wovon manche selbst Logging-Mechanismen verwenden (unter anderem Log4J). Kann es da zu Wechselwirkungen kommen?

Ich poste hier mal meinen classpath, auch wenn dieser sehr lang ist:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
	<classpathentry kind="src" path="src"/>
	<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
	<classpathentry exported="true" kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/commons-lang-2.4.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-api-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-common-schemas-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-common-utilities-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-bindings-soap-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-bindings-xml-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-core-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-databinding-jaxb-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-frontend-jaxws-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-frontend-simple-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-rt-transports-http-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/cxf-tools-common-2.0.7.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/epcis-commons-0.4.2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/geronimo-annotation_1.0_spec-1.1.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/jaxb-api-2.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/jaxb-impl-2.1.3.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/jaxws-api-2.0.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/saaj-api-1.3.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/saaj-impl-1.3.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/stax-api-1.0-2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/wsdl4j-1.6.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/wstx-asl-3.2.4.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/xml-resolver-1.2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/XmlSchema-1.4.2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/epcis-captureclient-0.4.2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/hibernate-core.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/ejb3-persistence.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/hibernate-annotations.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/hibernate-commons-annotations.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/mysql-connector-java.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/commons-collections-3.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/antlr-2.7.6.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/jta.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/jta-1.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/lib/activation-1.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/epcis-queryclient-0.4.2.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/dom4j-1.6.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Hibernate/javassist-3.4.GA.jar"/>
	<classpathentry exported="true" kind="con" path="DROOLS/Drools"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/antlr-2.7.5.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/arq-extra.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/arq.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/concurrent.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/icu4j_3_4.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/iri.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/jena.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/jenatest.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/json.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/junit.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/lucene-core-2.3.1.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/stax-api-1.0.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/wstx-asl-3.0.0.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/xercesImpl.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/xml-apis.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/aterm-java-1.6.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-cli.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-core.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-datatypes.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-dig.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-el.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-explanation.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-jena.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-modularity.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-pellint.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-query.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-rules.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/pellet-test.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/servlet.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/xsdlib/relaxngDatatype.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Pellet/xsdlib/xsdlib.jar"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/commons-logging-1.1.1.jar"/>
	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
	<classpathentry exported="true" kind="lib" path="libs/Jena/log4j-1.2.12.jar"/>
	<classpathentry kind="output" path="bin"/>
</classpath>

Könnte mir vielleicht jemand einen Hinweise geben woran es liegen könnte?

Vielen Dank,
Christoph
 
Habe heute durch Zufall das Rätsels Lösung entdeckt:
Man muss die slf4j-nop-*.jar im Classpath ganz nach oben schieben. Nur falls jmd mal über ein ähnliches Problem stolpert.

Gruß,
Christoph
 

Neue Beiträge

Zurück