Skip to content

Commit

Permalink
feat: Separate wiremock logger name with dot (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
egrimstad authored Mar 8, 2025
1 parent 3c71306 commit 5bc4182
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Slf4jNotifier implements Notifier {
private final Logger log;

Slf4jNotifier(final String name) {
this.log = LoggerFactory.getLogger("WireMock " + name);
this.log = LoggerFactory.getLogger("WireMock." + name);
}

@Override
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/test/LoggingTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ void outputsWireMockLogs(final CapturedOutput capturedOutput)
.build(),
HttpResponse.BodyHandlers.ofString());
assertThat(response.body()).isEqualTo("Hello World!");
assertThat(capturedOutput.getAll())
.as("Must contain correct logger name")
.contains("WireMock.todo-service", "WireMock.user-service");
assertThat(capturedOutput.getAll())
.as("Must contain debug logging for WireMock")
.contains("Matched response definition:");
Expand Down

0 comments on commit 5bc4182

Please sign in to comment.