# Logging config authored for CVE-2024-24549 reproduction.
#
# Privileged diagnostic channel for criterion surface (1):
# org.apache.coyote.http2 is raised to FINE (= DEBUG). When the HTTP/2 parser
# rejects an over-limit stream, Http2UpgradeHandler logs the StreamException
# WITH ITS STACK TRACE at debug level (log.debug(message, se)). On the
# vulnerable 10.1.18 build the stack trace contains
# org.apache.coyote.http2.Http2Parser.onHeadersComplete -> Stream.validateHeaders,
# i.e. validation fired at end-of-headers. The verifier reads this from the
# container's stdout (docker logs) and/or from logs/catalina.<date>.log.
#
# Both the ConsoleHandler (stdout) and the catalina file handler emit FINE, so
# the diagnostic is available on a privileged channel the verifier controls.

handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

############################################################
# Handler specific properties.
############################################################

1catalina.org.apache.juli.AsyncFileHandler.level = FINE
1catalina.org.apache.juli.AsyncFileHandler.directory = ${catalina.base}/logs
1catalina.org.apache.juli.AsyncFileHandler.prefix = catalina.
1catalina.org.apache.juli.AsyncFileHandler.maxDays = 90
1catalina.org.apache.juli.AsyncFileHandler.encoding = UTF-8

java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = org.apache.juli.OneLineFormatter
java.util.logging.ConsoleHandler.encoding = UTF-8

############################################################
# Facility specific properties.
############################################################

# Raise the HTTP/2 parser/handler package to FINE so per-stream rejection
# diagnostics (StreamException + stack trace) are emitted. This is the
# load-bearing line for surface (1).
org.apache.coyote.http2.level = FINE
org.apache.coyote.http2.handlers = 1catalina.org.apache.juli.AsyncFileHandler, java.util.logging.ConsoleHandler

# Keep the rest reasonably quiet.
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager].level = INFO
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager].level = INFO
