简体   繁体   中英

How to control Hibernate's logging?

I have a hibernate that is configured only programmatically ( I don't have a single XML file ).

I just finished writing my own implementation of org.slf4j.Logger.
How can I force hibernate to log to my implementation instead of the default one?

AFAIK you can't just change hibernates logging behaviour, but you can get slf4j to use your source with slf4j 'Bridging legacy APIs'

Ok if you re-implemented a slf4j logger, you are using the slf4j-api right ? if you are using Maven you could alter the dependencies for your project (see eg hibernate slf4j dependencies ) to use your implementation jar instead

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM