On 23/10/2016 18:24, minglei yin wrote: > Hi all, > > Recently, I want to implement a log functionality which is very similar to > log mechanism in Tomcat. So I am here to ask some helps. > > 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.
There are multiple components to this: - The custom LogManager that maintains a separate set of loggers for each class loader - Configuring Tomcat to use this in the start-up scripts - Ensuring that the Thread context class loader is set before obtaining a logger. > Really thank you guys for any suggestions and advice. You can learn a lot by configuring Tomcat for remote debugging and stepping your way through the relevant code with your favourite IDE. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org