Recently, I want to implement a log functionality which is very similar to the log mechanism of Tomcat
. I just want to know, how Tomcat
implements that different web applications can have different logging configurations and you do not need to worry about them interfering with each other. As I found some info by google before, Tomcat uses its own custom ClassLoaderLogManager
which is classloader-aware. And I know this. But through my own experiment that I changed the ClassLoaderLogManager.java
and replaced the tomcat-juli.jar
, I found that when I called logger.info("")
, it seemed that the introduced log interface in my web-app did not have a interaction with ClassLoaderLogManager
. So I really just do not know how Tomcat
gets this done.
And also, what should I do if want to implement different log outputs by different classloader in just one Java application?