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

Commit

Permalink
actually test that file and line are output when logging an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pktxu committed Mar 3, 2014
1 parent 2dc099d commit 7b9b2cd
Showing 1 changed file with 4 additions and 0 deletions.
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

0 comments on commit 7b9b2cd

Please sign in to comment.