qos-ch / logback-access

Logback access jakarta project
Other
8 stars 8 forks source link

Logback-access 2.0.1 does not work using included resources for Tomcat access logs #14

Closed RobbanHoglund closed 3 months ago

RobbanHoglund commented 5 months ago

Logback 1.5.6 does not work using included resources for Tomcat access logs

From startup.

11:19:28,784 |-INFO in ch.qos.logback.access.tomcat.LogbackValve[null] - Found [logback-access.xml] as a resource. 11:19:28,795 |-INFO in ch.qos.logback.access.common.model.processor.ConfigurationModelHandler - debug attribute not set 11:19:28,795 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@78a287ed - Adding [jar:file:/C:/Users/p950rhw/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/3.3.0/83d42f81f312d71b9425f58d1d3f9e8970e51b22/spring-boot-3.3.0.jar!/org/springframework/boot/logging/logback/defaults.xml] to configuration watch list. 11:19:28,795 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@7b4619a3 - URL [jar:file:/C:/Users/p950rhw/.gradle/caches/modules-2/files-2.1/org.springframework.boot/spring-boot/3.3.0/83d42f81f312d71b9425f58d1d3f9e8970e51b22/spring-boot-3.3.0.jar!/org/springframework/boot/logging/logback/defaults.xml] is not of type file 11:19:28,799 |-ERROR in ch.qos.logback.core.model.processor.IncludeModelHandler - null configurator supplier. Abandoning inclusion of [org/springframework/boot/logging/logback/defaults.xml] 11:19:28,799 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@78a287ed - Adding [file:/C:/ws/git/lib-logging/bin/main/andromeda-access-console-appender.xml] to configuration watch list. 11:19:28,801 |-ERROR in ch.qos.logback.core.model.processor.IncludeModelHandler - null configurator supplier. Abandoning inclusion of [andromeda-access-console-appender.xml] 11:19:28,801 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@78a287ed - Adding [file:/C:/ws/git/lib-logging/bin/main/andromeda-access-observability-appender.xml] to configuration watch list. 11:19:28,803 |-ERROR in ch.qos.logback.core.model.processor.IncludeModelHandler - null configurator supplier. Abandoning inclusion of [andromeda-access-observability-appender.xml] 11:19:28,803 |-INFO in ch.qos.logback.core.joran.util.ConfigurationWatchListUtil@78a287ed - Adding [file:/C:/ws/git/lib-logging/bin/main/andromeda-access-logread-appender.xml] to configuration watch list. 11:19:28,806 |-ERROR in ch.qos.logback.core.model.processor.IncludeModelHandler - null configurator supplier. Abandoning inclusion of [andromeda-access-logread-appender.xml] 11:19:28,806 |-INFO in ch.qos.logback.core.model.processor.DefaultProcessor@9d3a7a1 - End of configuration. 11:19:28,806 |-INFO in ch.qos.logback.access.common.joran.JoranConfigurator@1c411474 - Registering current configuration as safe fallback point

image

The configuration supplier ends up being null.

This works fine with Spring boot 3.2.5 and logback 1.4.14 with but not with Spring boot 3.3.0 and logback 1.5.6

ceki commented 5 months ago

@RobbanHoglund I believe this issue is related to https://github.com/spring-projects/spring-boot/issues/40491

Upgrading to spring-boot 3.3 should fix the issue. If you could please test and report back here, that would be great.

RobbanHoglund commented 5 months ago

We just upgraded to Spring-boot 3.3.0 and then our customized access-logs stopped working.
I think this change is the reason https://github.com/qos-ch/logback/commit/af92be47a940393e11decab0a7ee4cb802d2b5e8#diff-3538035db17d89a86f9994c100501b7459ca7a961a4fc843dd95a02a21326b1b

RobbanHoglund commented 5 months ago

And Spring fixed it for the applications logs here https://github.com/spring-projects/spring-boot/commit/3c00bf367d7b03d8b8e005e8097c295996290b59#diff-7d71ee2ca0b78c3f953c1d4a753583f773d0c6d840cc195a6249389714c2166a

But it is NOT working for Tomcat´s access-logs

ceki commented 5 months ago

@RobbanHoglund I think this is a logback-access issue. Which version of logback-access are you using? Which version of Tomcat?

RobbanHoglund commented 5 months ago

Here is the tomcat deps which are from Spring´s dependency management

image

https://github.com/spring-projects/spring-boot/blob/v3.3.0/gradle.properties#L18

ceki commented 5 months ago

Thank you for this information. Which version of logback-access are you using?

RobbanHoglund commented 5 months ago

Here are the deps. which you recommended here: https://logback.qos.ch/access.html

image

image

ceki commented 5 months ago

Issue fixed in commit c9447c53b5919d87 to be released in version logback-access version 2.0.2

dskeppstedt commented 5 months ago

Hi, @ceki have the same issue is it possible to get a snapshot version to verify the fix? Managed to build the project locally and use the jars for common and tomcat, works as expected!

Super nice with the quick fix, thanks!

RobbanHoglund commented 5 months ago

Thanks for a quick fix of this issue, when is 2.0.2 planned to be released?

ceki commented 5 months ago

Thanks for a quick fix of this issue, when is 2.0.2 planned to be released?

Not before sometime in June I am afraid.

dskeppstedt commented 4 months ago

any update on this?

runeflobakk commented 4 months ago

I have tested this with a Spring Boot 3.3.1 application running on Jetty 12. The issue exists with Jetty as well, and I can confirm that the commit https://github.com/qos-ch/logback-access/commit/c9447c53b5919d8 fixes it for Jetty also 👍

It also works together with the Support for logback-access 2.0.0 PR for logstash-logback-encoder (yet to be merged at time of writing)

ceki commented 3 months ago

Fixed in logback-access version 2.0.2 which was released on 2024-07-08.