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

Resetting loggerContext stops logging of events #926

Open
cke42 opened this issue Feb 17, 2025 · 3 comments
Open

Resetting loggerContext stops logging of events #926

cke42 opened this issue Feb 17, 2025 · 3 comments
Assignees
Labels

Comments

@cke42
Copy link

cke42 commented Feb 17, 2025

I use logback configuration with scan="true" that reconfigures logback whenever logback.xml changes. However, the first reload causes that no more logback events are recorded.

I added 'debug="true"' to the logback.xml file and do see the following lines after a change of the file logback.xml:

10:47:39,128 |-INFO in ReconfigureOnChangeTask(born:1739785644121) - Detected change in configuration files. 10:47:39,128 |-INFO in ReconfigureOnChangeTask(born:1739785644121) - Will reset and reconfigure context named [default] 10:47:39,129 |-INFO in ReconfigureOnChangeTask(born:1739785644121) - Resetting loggerContext [default]

Attached project
The attached project can be used to reproduce this issue. The project was created using the KMP Wizard only selecting 'Desktop'. Main changes are adding logback libraries and few log outputs.

Steps to reproduce the issue:

  • compile and build the project
  • execute the program
  • change the file logback.xml that is located in the folder './KMPLogbackSample/lib/app/resources'

Many thanks in advance!

KMPDesktopLogbackSample.tar.gz

@ceki ceki self-assigned this Feb 17, 2025
@ceki ceki added the UNCLEAR label Feb 17, 2025
@ceki
Copy link
Member

ceki commented Feb 17, 2025

@cke42 Thank you for your report. Can you please provide a shorter/simpler test case using only Java? I cannot import untrusted projects for security reasons.

@cke42
Copy link
Author

cke42 commented Feb 17, 2025

@ceki Thanks a lot for your very fast response! Sorry, but I currently have no idea how to provide a shorter/simpler test case.
Basically you can use the logback.xml used within the provided project, attach it to any simple project using logback and change the logback.xml file.

Do you have any simple Java project using logback that I could use within Eclipse for testing purposes?

@ceki
Copy link
Member

ceki commented Feb 17, 2025

See Maven's quickstart archetype at https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

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