Reputation: 4798
I am wandering if there is an elegant way to change logging in hybris from log4j to slf4j or something else?
Right now I am using slf4j when writing java code, but hybris itself is using log4j for any generated code. That is causing to use mixed logging frameworks in one hybris extension. Actually it is still log4j underneath the slf4j, but what if I want to change log4j to some other logging mechanism?
Maybe it can be done in some configuration file. Has anybody done that already?
Upvotes: 2
Views: 1161
Reputation: 42020
Depending on your current configuration, you can use a bridge between log4j and slf4j.1
In this way, you wouldn't need to modify the generated code. You can use a similar configuration if you use Log4J 2 as underlying logging framework.
See also Bridging legacy APIs in www.slf4j.org.
Notes
Upvotes: 3