I am trying to enter slf4j logger through Guice DI. So far I have implemented an easy way; I tied Logger.classto the root log slf4j.
I'm currently trying to do it right, and enter the class name in the method LoggerFactory.getLogger(). However, I'm not sure how to access the name of the input class.
I saw an example using field injection , but I did not find any example that does this using constructor injection.
Can this be done?
Edit:
I stopped trying to do any magic, and I just insert an instance LoggerFactory(the wrapper over it is actually). This simplifies everything and it allows me to get any instance Loggerthat I need for a particular class.
source
share