Skip to content

Moqui now honors the standard Log4j property 'log4j.configurationFile'#706

Open
jmochel wants to merge 1 commit intomoqui:masterfrom
jmochel:reconfigure-logging-from-standard-log4j-override
Open

Moqui now honors the standard Log4j property 'log4j.configurationFile'#706
jmochel wants to merge 1 commit intomoqui:masterfrom
jmochel:reconfigure-logging-from-standard-log4j-override

Conversation

@jmochel
Copy link

@jmochel jmochel commented Mar 21, 2026

Intention:

To give developers the same level of control during logging of components and the framework they have in other products using Log4j.

What it does:

This change replaces the use of the hard coded log4j.xml from the jar resources with

  1. A use of the contents of the standard Log4J configuration file override property (log4j.configurationFile) from system properties or environment variables if it is set in either.
  2. If no location is found, it tries to find "log4j2.xml" on the classpath (basically, as a resource bundled with the code or libraries).
  3. If it can't find a configuration file in either location, it logs a warning and stops (does not attempt to reconfigure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant