[MAGNOLIA-3738] Watch Log4j configuration for live changes Created: 22/Jun/11  Updated: 19/Dec/16  Resolved: 04/Nov/15

Status: Closed
Project: Magnolia
Component/s: core
Affects Version/s: 4.4.4
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: Nils Breunese Assignee: Unassigned
Resolution: Won't Do Votes: 1
Labels: vpro
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 Description   

info.magnolia.logging.Log4jConfigurer uses DOMConfigurator.configure(Element element) and PropertyConfigurator.configure(Properties properties), so the Log4j configuration is read once, but when we want to change the configuration, for instance to debug a problem on a production instance, we need to restart our Magnolia instances.

If would be nice if the configureAndWatch(String configFilename) methods could be used instead, so changes to the Log4j configuration do not require restarting Magnolia.



 Comments   
Comment by Daniel Lipp [ 21/Jul/11 ]

ConfigureAndWatch methods are only available with String (configFilename) as param (for both, xml and properties format) - we allow variables in the configs that get substituted before the config is loaded. This cannot easily be combined with the before mentioned methods.

In addition it's questionable to have another thread just to watch the log-config - it'll most probably not change frequently.

Another solution for the mentioned "adapt config to debug a problem on a production instance" is to use the Menu Tools -> Logging. Of course these changes will not be persisted but you still can adapt the log config without having to restart the server.

Comment by Danilo Ghirardelli [ 22/Jul/11 ]

Isn't this the same as using the "Tools -> Logging" configuration page?
Or do you need to change the rotation and files on the fly?

Comment by Nils Breunese [ 22/Jul/11 ]

We were looking to change the log levels for some class or package to debug a problem in production, so yes, I believe "Tools -> Logging" would have served us quite well. Thanks for the pointer, we completely missed that.

Comment by Danilo Ghirardelli [ 22/Jul/11 ]

I suppose it would help writing a good detailed page about that even in the official documentation...

Comment by Daniel Lipp [ 22/Jul/11 ]

Hi guys - as you might have seen in SVN I worked on it yesterday, but set my comment (July 21th, 3:48PM) to "public" only today. So yep - "Tools -> Logging" is the thing. I'll forward the hint about the docu to our technical writer!

Comment by Michael Mühlebach [ 04/Nov/15 ]

Given the thousands of other issues we have open that are more highly requested, we won't be able to address this issue in the foreseeable future. Instead we will focus on issues with a higher impact, and more votes.
Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement.
I'm going to close this to set expectations so the issue doesn't stay open for years with few updates. If the issue is still relevant please feel free to reopen it or create a new issue.

Generated at Mon Feb 12 03:49:13 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.