Repository navigation
Fix HTTP appender handling of invalid evaluated headers - #4360
ramanathan1504 merged 5 commits into
Conversation
ramanathan1504
left a comment
There was a problem hiding this comment.
The try/catch in HttpURLConnectionManager keeps the event when ${ctx:tenant} has a line break, and the new test fails without it.
The LOGGER.warn line has no test yet, so can the test also check the status listener for it (suggestion inline)? Please also add a fixed entry for #4352 under src/changelog/.2.x.x/.
Assisted-by: Codex (GPT-5) Signed-off-by: Efe Gökdemir <efe@rexcode.co.uk>
|
Updated in
|
|
@efegokdemir Thanks for contributing. Before committing a code or adding comments, can you please check the |
|
Re-audited #4360, #4359, and #4358 against their current heads after reading
I ran the repository Spotless command ( |
|
Re-audited #4358, #4359, and #4360 against their current heads and followed
The auxiliary |
Summary
An evaluated HTTP appender header can contain a line break from runtime context data.
HttpURLConnectionrejects that value withIllegalArgumentException, which previously aborted the append and dropped the complete log event.This change skips only the invalid header, logs a warning, and continues sending the event.
Changes
Testing
JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.20.1/libexec/openjdk.jdk/Contents/Home PATH="$JAVA_HOME/bin:$PATH" mvn -pl log4j-core-test -am test-compile org.apache.maven.plugins:maven-surefire-plugin:3.5.2:test@default-test -Dtest=HttpAppenderTest -Dsurefire.failIfNoSpecifiedTests=false -Dspotless.check.skip=true -Dspotless.apply.skip=true— passed (8 tests)JAVA_HOME=/opt/homebrew/Cellar/openjdk@17/17.0.20.1/libexec/openjdk.jdk/Contents/Home PATH="$JAVA_HOME/bin:$PATH" mvn -pl log4j-core-test,log4j-core -am spotless:check— passedgit diff --check— passedAI assistance was used during implementation; the submitted change and validation were reviewed for this contribution.
Fixes #4352