tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Getting Tomcat internal logging working
Date Thu, 07 Nov 2019 02:44:26 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

All,

I can't believe I'm having trouble with this, but I'm struggling with
enabling logging.

I'm experimenting with the CsrfPreventionFilter, which currently has
zero logging at all in it. So, first I modified the code to add:

+     private final Log log =
LogFactory.getLog(CsrfPreventionFilter.class);

and, later

        if (nonceCache == null || previousNonce == null ||
                !nonceCache.contains(previousNonce)) {
+           log.trace("nonceCache=" + (null == nonceCache ? "(null)" :
nonceCache.cache));
+           log.trace("previousNonce=" + previousNonce);
+           log.trace("nonceCache.contains=" + (null == nonceCache ?
"(null)" : nonceCache.contains(previousNonce)));

            res.sendError(getDenyStatus());
            return;
        }

Finally, I modified these lines in $CATALINA_BASE/conf/logging.propertie
s:

- - java.util.logging.ConsoleHandler.level = FINE
+ java.util.logging.ConsoleHandler.level = ALL

...

+ org.apache.catalina.filters.level=ALL

When running, I see no logging when I'm expecting to see things in
catalina.out. I changed these lines from log.trace() to
System.err.println() and they do indeed show up.

What am I missing?

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAl3DhQoACgkQHPApP6U8
pFh9WQ/+P6GkuDL9YVWq2+Uv++e8dCgYSGo1hNr+1olun5+LzkWl9y4hfRpineVV
R4KHaeEoq24VJZWN8PmzZRZnkETLnATGZ82vTzVDJi+pfbxn+bC4e3wCRedUb6p1
Ieoro6II5p/621aQkClMQMht/ruu2PpEHx7qPjYa77x+fl4crDCq4cJ8fLeACUGZ
tTKnEZYqw/vE6eUozLE/KDYVSRmsvzE6PZ7Rk8Duv8k2dFHovwXoTkvPxZ8o8q/v
lWl20iPIsy+8otWbWx+/9fmm8LnPmD3cd1FhaczL86omOp1VYfMFW9KsMQMcZTaw
4jVkb9uJva1eupJu4CoNCecCRiOK0/RznkuA4wO210TqUC4pzSoZHQVIzM+oO9J0
JYrbR3dqmKXaBrSB7vGt2SnooD4QJPRTVGpYRmt8Xe42uXrZ1OPawb7fnOZntjQg
MvvFZa4QcUv69jBntfaopiMFLU+PcQMH6xVLw8dy1EGRAcEzD+FnVhNpir82NdXD
ZcVUGeUZrt+rw6+MLr6i8Due0hd5WYaaggH/obDle9lgaySB81jSsZTKwqTBo4Tv
KFKuL5NTKnQ/3vsWngRW/KuX50LDVXdY3Uhs0ZDKeUj/nQipc16s//KH4E7jaSsh
opaJDbUL+WU9tP/EWTmxTUptaNO6wz6do/QDIfEGk2RePvWSjpA=
=Psm0
-----END PGP SIGNATURE-----

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


Mime
View raw message