-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log4j2: add option to fill code attributes #12592
base: main
Are you sure you want to change the base?
Conversation
cc @jeanbisutti in case you have a chance to review |
} | ||
if (stackTraceClass == null) { | ||
try { | ||
stackTraceClass = Class.forName("org.apache.logging.log4j.core.impl.Log4jLogEvent"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stack trace class is not the same following the Log4j version? If so, could you please add comments to explain this?
It's perhaps the intent of the comment added at line 121? If so, could you please move this comment around the line 124?
StackTraceElement source = sourceSupplier.get(); | ||
if (source != null) { | ||
String fileName = source.getFileName(); | ||
if (fileName != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(optional)
if (fileName != null) { | |
// file name can be null from the StackTraceElement Javadoc | |
if (fileName != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is copy-pasted from the logback instrumentation. Apparently you are the author of it.
Class<?> testClass, String methodName, AttributeAssertion... assertions) { | ||
String selector = System.getProperty("Log4j2.contextSelector"); | ||
boolean async = selector != null && selector.endsWith("AsyncLoggerContextSelector"); | ||
if (async) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not found the test using an asynch appender. Could you please give me a pointer?
The Readme should perhaps explain something about the asynch appenders?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 48 to 54 in 29da88e
val testAsync by registering(Test::class) { | |
jvmArgs("-DLog4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector") | |
} | |
check { | |
dependsOn(testAsync) | |
} |
110c4b5
to
3eca7a1
Compare
Resolves #12540