ср, 31 авг. 2022 г. в 13:25, tianshuang <tianshuang...@icloud.com.invalid>: > > Hi, > > In this commit > <https://github.com/apache/tomcat/commit/dd44360b2ce8e5e1b79c756723158944264f556e>, > the static modifier was removed from the log variable in the Filters class, > but I don't understand why it needs to be removed. As far as I know, when a > class is loaded by different classLoader, each classLoader creates its own > instance of static variable. So, is it necessary to remove the static > modifier here? > > commit url: > https://github.com/apache/tomcat/commit/dd44360b2ce8e5e1b79c756723158944264f556e
See classloader hierarchy here: https://tomcat.apache.org/tomcat-10.1-doc/class-loader-howto.html https://tomcat.apache.org/tomcat-8.5-doc/class-loader-howto.html When Webapp classloader loads the Filter class, it does not "load the class" (i.e. does not read the bytes from a jar archive and does not produce a Class out of those bytes). It delegates the task to its parent in the classloader hierarchy. Thus, the Filter class is loaded by the Common classloader. At the same time, the logging configuration for each web application may be different: A web application may provide its own copy of logging.properties file by placing it into its own WEB-INF/classes/ directory. https://tomcat.apache.org/tomcat-8.5-doc/logging.html#Using_java.util.logging_(default) Best regards, Konstantin Kolinko --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org