Wayang depends on Log4j 2, but bin/wayang-submit passed the Log4j 1
property -Dlog4j.configuration when FLAG_LOG=true. Log4j 2 ignores that
property, and conf/ did not ship a logging configuration, so FLAG_LOG
had no effect.
Pass -Dlog4j2.configurationFile instead and ship a default
conf/log4j2.properties that logs INFO and above to stderr. Because the
file lives in the source conf/ directory, the assembly copies it into
the distribution and it is no longer lost on a clean install.
Generated-by: Claude Opus 5 (Claude Code)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Closes #536
Problem
Wayang uses Log4j 2 (log4j-bom 2.20.0), but bin/wayang-submit passed the Log4j 1 property when FLAG_LOG=true:
-Dlog4j.configuration=file://${WAYANG_CONF}/log4j.propertiesLog4j 2 ignores that property, and conf/ did not ship a logging configuration, so FLAG_LOG had no effect. Running WordCount from the distribution with FLAG_LOG=true on current main prints:
and only errors are logged. A file created manually in $WAYANG_HOME/conf is also lost on the next clean install, because that directory is regenerated from the source conf/ directory by the assembly.
Change
Behaviour without FLAG_LOG is unchanged.
Testing
All workflows of this repository passed on this commit in my fork (Backend incl. license check, Maven and Python tests; Docker incl. WordCount smoke test; CodeQL).
In addition I ran an end-to-end check on the built distribution image (Linux, JDK 17):
Notes (not changed here)
While checking which logging jars end up in libs/, I noticed the distribution also ships log4j-1.2.17.jar, reload4j-1.2.22.jar, slf4j-reload4j-1.7.36.jar and slf4j-simple-2.0.16.jar next to the Log4j 2 jars, which causes the SLF4J: Class path contains multiple SLF4J providers warning. wayang-api-sql also has two log4j.properties files that reference an undefined appender A1 (visible as log4j:ERROR Could not find value for key log4j.appender.A1 in CI). I kept this PR focused on #536 and can follow up on these separately if that is useful.
The contribution is my original work and I license the work to the project under the project's open source license.
AI assistance: parts of this change were prepared with an AI tool (Claude Code), disclosed in the commit with a Generated-by: trailer, following the project's AI-assisted contributions guidelines.
🤖 Generated with Claude Code