Skip to content

fix: migrate legacy dir.logs log4j property#275

Open
mgaffigan wants to merge 2 commits intoOpenIntegrationEngine:mainfrom
mgaffigan:copilot/fix-log4j2-properties-invalid-line
Open

fix: migrate legacy dir.logs log4j property#275
mgaffigan wants to merge 2 commits intoOpenIntegrationEngine:mainfrom
mgaffigan:copilot/fix-log4j2-properties-invalid-line

Conversation

@mgaffigan
Copy link
Copy Markdown
Contributor

Fixes a crash on boot caused by dir.logs set in log4j2.properties, which is not supported in log4j2. Cannot use normal migration infra since log4j is initialized early in the boot processs (before classpath is fully set up).

Closes #267

@mgaffigan mgaffigan force-pushed the copilot/fix-log4j2-properties-invalid-line branch 2 times, most recently from 2001324 to feb6b06 Compare March 27, 2026 17:28
Fixes a crash on boot caused by dir.logs set in log4j2.properties, which
is not supported in log4j2.  Cannot use normal migration infra since
log4j is initialized early in the boot processs (before classpath is
fully set up).

Issue: OpenIntegrationEngine#267
Signed-off-by: Mitch Gaffigan <mgaffigan@users.noreply.github.com>
@mgaffigan mgaffigan force-pushed the copilot/fix-log4j2-properties-invalid-line branch 2 times, most recently from bbf0117 to 71a5c24 Compare March 27, 2026 17:37
Signed-off-by: Mitch Gaffigan <mitch.gaffigan@comcast.net>
@mgaffigan mgaffigan force-pushed the copilot/fix-log4j2-properties-invalid-line branch from 71a5c24 to d17ee13 Compare March 27, 2026 17:42
@mgaffigan mgaffigan marked this pull request as ready for review March 27, 2026 17:44
@mgaffigan mgaffigan requested review from a team, NicoPiel, gibson9583, jonbartels, kayyagari, kpalang, ssrowe and tonygermano and removed request for a team March 27, 2026 17:44
@github-actions
Copy link
Copy Markdown

Test Results

  111 files  +1    214 suites  +2   7m 6s ⏱️ + 1m 14s
  654 tests +4    654 ✅ +4  0 💤 ±0  0 ❌ ±0 
1 308 runs  +8  1 308 ✅ +8  0 💤 ±0  0 ❌ ±0 

Results for commit d17ee13. ± Comparison against base commit bfe3348.

}

private static boolean stripDirLogs(List<String> lines) {
return lines.removeIf(line -> isPropertyLine(line, INVALID_LOG4J_PROPERTY));
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the meat of the change. I have some dumb questions:

  1. To migrate this property should it be copied to the new property.log.dir if it is something other than the default value? f7a1b43#diff-51942c75283fcd64879e532ee86d52ac8aec09b833cd3b686855eb75b16c4185R5-L12
  2. Should this be using readlines? Could it instead just parse the properties file using a standard Java Properties parser?
  3. Remove the line, comment the line, or comment the line and add an explanatory text?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonbartels, not dumb at all. Reasonable questions.

  1. In my understanding, the previous line was a no-op. We're also not changing the actual log dest (so any destination they set prior will be maintained). @tonygermano, can you confirm?
  2. I'm ambivalent re: readlines vs Java Properties parser. I think the properties parser would clear any comments and formatting, but not sure.
  3. Since the line had no effect, I think removing it is appropriate, but ¯\_(ツ)_/¯

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] log4j2.properties invalid line causing server startup failure

3 participants