Konstantin,

On 12/20/23 12:10, Konstantin Kolinko wrote:
пт, 1 дек. 2023 г. в 23:27, Christopher Schultz <ch...@christopherschultz.net>:

[...]

I build-from-source and launch my custom-build Tomcat with my
application in it. No logging. Oh, right... logging.properties. So I add
this to my conf/logging.properties file:

org.apache.catalina.filters.CsrfPreventionFilter.level = FINEST

To be sure there's no funny business, I use "catalina.sh run" and wait
for the console log to settle down. I make a few requests. No logs. Hmm.
Oh, the ConsoleAppender is set to FINE and not FINEST.

java.util.logging.ConsoleHandler.level = FINEST

Done. CTRL-C, catalina.sh run. Make some requests.

Nothing. Okay.... maybe the Filter is just ignoring these for some
reason.

Regarding the logging issue: It is worth to check
a) If you have a "logging.properties" file in your class path.

I.e. if the web application has its own configuration of logging.
(Usually in lib/classes, but in bad cases one may be present in a
library jar file.)

Thanks for your reply. I actually came to the same conclusion right about the time you were writing this.

I had been trying to configure this in CATALINA_BASE/conf/logging.properties and I needed to do it in my application's WEB-INF/classes/logging.properties file.

So it's working entirely as expected, now. :)

b) What are the values of "java.util.logging.manager" and
"java.util.logging.config.file" properties.
I.e. whether JULI is used at all.

If nothing else, remote debugging should help. ;)

I ended up using a remote debugger to poke-around in the runtime Logger object to see what was happening. No amount of configuration changes in conf/logging.properties was making any change to the logger, but fiddling with the in-memory object via debugger would make it do ... something. Then it occurred to me that the configuration was in the wrong place :)

-chris

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

Reply via email to