Skip to content
This repository has been archived by the owner on May 31, 2021. It is now read-only.

actually test that file and line are output when logging an exception #34

Merged
merged 1 commit into from
May 18, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/test/java/me/moocar/logbackgelf/IntegrationTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ public void test() throws IOException, JoranException {
try {
new URL("app://asdfs");
} catch (Exception e) {
int ln = Thread.currentThread().getStackTrace()[1].getLineNumber();
logger.error("expected error", new IllegalStateException(e));
sleep();
lastRequest = server.lastRequest();
assertEquals(ln + 1, Integer.parseInt((String) lastRequest.get("line")));
assertEquals(this.getClass().getSimpleName() + ".java", lastRequest.get("file"));
}

// Test field in MDC is added even if not included in additional fields
Expand Down