Repository navigation
test(log4j2): [Sample Tests 30] Move the log4j2 sample's system test into sentry-log4j2 - #6322
Draft
runningcode wants to merge 1 commit into
Draft
runningcode wants to merge 1 commit into
runningcode wants to merge 1 commit into
Conversation
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
Draft
📲 Install BuildsAndroid
|
This was referenced Oct 20, 2026
Draft
Draft
Draft
Draft
runningcode
force-pushed
the
no/spring-integration-test
branch
from
October 21, 2026 09:19
e40433c to
c037b50
Compare
runningcode
force-pushed
the
no/log4j2-integration-test
branch
from
October 21, 2026 09:19
c1501a1 to
b5f1f6a
Compare
Adds SentryAppenderIntegrationTest, which configures the Sentry appender from XML in a logger context of its own and checks what reaches MockSentryServer: the warning event with its context tag and flag, the error with its exception and breadcrumbs, and the logs with their attributes. Logs are enabled through external configuration, as the sample's sentry.properties does, because the appender has no attribute for them. The sample has no system tests left, so it comes off the system-test runner and the backend workflow, and drops the Kotlin plugin it only needed for the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
runningcode
force-pushed
the
no/log4j2-integration-test
branch
from
October 21, 2026 11:27
b5f1f6a to
a75e37b
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Sample Tests)
main)📜 Description
Moves
sentry-samples-log4j2's system test intosentry-log4j2asSentryAppenderIntegrationTest, the log4j2 version of the logback test in #6268. The sample's test ran its JAR against the Python mock server. The new test configures the Sentry appender from XML in-process and checks what reachesMockSentryServer:userIdcontext tag and feature flag;RuntimeExceptionand the debug and info breadcrumbs;Two details:
sentry-appender-integration-test.xml, so it covers howlog4j2.xmlbinds the appender's attributes. The DSN reaches it through a${sys:...}lookup. The test builds aLoggerContextof its own from the file, soSentryAppenderTest's context keeps its configuration.sentry.properties, so the test uses the same external-configuration path, through thesentry.logs.enabledsystem property.With no system tests left, the sample comes off the runner and the backend workflow. It also drops the Kotlin plugin, which only the test needed.
sentry-log4j2gets Truth as a test dependency.💡 Motivation and Context
The log4j2 appender's XML binding now runs in
./gradlew :sentry-log4j2:test, in about 0.2 seconds.💚 How did you test it?
:sentry-log4j2:checkpasses, and the sample's JAR still builds.📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
The JUL sample, then the plain console sample.
#skip-changelog
🤖 Generated with Claude Code