tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Getting Tomcat internal logging working
Date Fri, 08 Nov 2019 16:54:40 GMT
> Konstantin,
> 
> On 11/7/19 15:20, Konstantin Kolinko wrote:
>> чт, 7 нояб. 2019 г. в 17:11, Christopher Schultz
>> <chris@christopherschultz.net>:
>>>
>>> I'm using bin/catalina.sh start to launch Tomcat on Macos. The
>>> 'ps' command shows the following partial command-line:
>>>
>>> [...] -
>>> -Djava.util.logging.config.file=${CATALINA_BASE}/conf/logging.propert
> ies
>>>
>>>
> - -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager [...
> ]
>>>
>>> The file ${CATALINA_BASE}/conf/logging.properties does indeed
>>> have the changes below.
> 
>> OK, good.
> 
>> (I hope that `ps` shows the actual path to logging.properties.
>> There should not be unexpanded reference to a environment variable
>> above.)
> 
> Yep. I hand-edited that to shorten the real path.
> 
>> This reminds me: ClassLoaderLogManager allows each web application
>> to have its own configuration of logging. If you have a 
>> "logging.properties" file elsewhere in classpath of that web 
>> application, it will have precedence over the default one.
> 
>> The recommended use of this technology is to place your
>> configuration into WEB-INF/classes/logging.properties file of your
>> web application.
> 
> My web application DOES have a WEB-INF/classes/logging.properties and
> it does indeed say nothing about the CsrfPreventionFilter.
> 
> Since the TCCL is the WebappClassloader during execution of the Filter
> (it's defined in my app's WEB-INF/web.xml file), it must be using the
> application's logging.properties and not the global one.
> 
> This makes sense and is a little irritating to me, but definitely
> fixable. I'll double-check that this is the case, shortly.
> 
> I think I'm going to commit my trace logging to CsrfPreventionFilter
> because I find it helpful to see what's happening in there when trying
> to deploy CSRF protections.

+1 but please use debug. Tomcat generally doesn't use trace. The
expectation is that debug enables all logging.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message