Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config xml in jar file cannot be watched #928

Open
benno-mueller-saxess opened this issue Mar 19, 2025 · 2 comments
Open

config xml in jar file cannot be watched #928

benno-mueller-saxess opened this issue Mar 19, 2025 · 2 comments
Assignees
Labels

Comments

@benno-mueller-saxess
Copy link

benno-mueller-saxess commented Mar 19, 2025

The example from https://docs.spring.io/spring-boot/how-to/logging.html does not work because the defaults.xml is in a jar (jar:file:/path/to/.m2/repository/org/springframework/boot/spring-boot/3.4.2/spring-boot-3.4.2.jar!/org/springframework/boot/logging/logback/defaults.xml). It outputs:

ConfigurationWatchList(mainURL=file:/path/to/apache-tomcat-10/webapps/portal-war/WEB-INF/classes/logback-spring.xml, fileWatchList={/path/to/apache-tomcat-10/webapps/portal-war/WEB-INF/classes/logback-spring.xml, /path/to/apache-tomcat-10/webapps/portal-war/WEB-INF/classes/logback/file-appender.xml}, urlWatchList=[}) - Cannot watch [jar:file:/path/to/apache-tomcat-10/webapps/portal-war/WEB-INF/lib/spring-boot-3.4.2.jar!/org/springframework/boot/logging/logback/defaults.xml] as its protocol is not one of file, http or https.

Tested with Logback Version 1.5.16 and 1.5.18

It was changed in commit a496a04 - see ch.qos.logback.core.joran.spi.ConfigurationWatchList#addToWatchList(URL)
(Changed in version 1.5.9)

Please add the support for XML-Config-Files in jar files as before this commit.

@ceki ceki self-assigned this Mar 19, 2025
@ceki ceki added the UNCLEAR label Mar 19, 2025
@ceki
Copy link
Member

ceki commented Mar 19, 2025

@benno-mueller-saxess Thank you for your report.

As far as I understand, it makes no sense to watch for changes in jar files as they are certain to not change during the lifetime of the application (at least not without stop/start). Thus, I fail to see the problem. Can you please expand on your remarks?

@benno-mueller-saxess
Copy link
Author

benno-mueller-saxess commented Mar 19, 2025

@ceki Thanks for your quick response.

Maybe I missunderstood something. As I understand, the file is used, but not watched. Is this correct?
If this is true, the message is missleading, because it is nothing bad. Logging a message for this provides the user no useful information for a file in a jar file. It confuses the user instead. Surely you can optimize this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants