Skip to content

Commit

Permalink
add failing test for apache/logging-log4j2#1533
Browse files Browse the repository at this point in the history
  • Loading branch information
oshai committed Jul 12, 2023
1 parent 112fc1a commit 8645615
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ class ClassWithLoggingForLocationTesting {
logger.info { "log entry body" }
return logger.exit(null)
}

fun logFluentWithPayload() {
logger.atInfo {
message = "test"
payload = mapOf("key" to "value")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ class LoggingWithLocationTest {
)
}

@Test
fun testFluentLoggingWithLocation() {
ClassWithLoggingForLocationTesting().logFluentWithPayload()
assertEquals(
"INFO ClassWithLoggingForLocationTesting.logFluentWithPayload(32) - test",
appenderWithWriter.writer.toString().trim()
)
}

@Test
fun testNullLoggingWithLocation() {
ClassWithLoggingForLocationTesting().logNull()
Expand Down

0 comments on commit 8645615

Please sign in to comment.