I have to use a custom logger for Tomcat. Extending java.util.logging.Handler
I implemented a bridge to the custom logger. It gets instanciated via WEB-INF/classes/logging.properties
.
But it needs to beconfigured by a property file from the war. So I need the ServletContext to do servletContext.getResourceAsStream(iniFileName)
. Since the custom Logger is created by the java logging mechanism, I am not able to get the ServletContext from a Servlet constructor or via dependency injection.
How do I get a ServletContext before any Servlet was created?