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

Commit

Permalink
Merge pull request #34 from pktxu/master
Browse files Browse the repository at this point in the history
actually test that file and line are output when logging an exception
  • Loading branch information
Moocar committed May 18, 2014
2 parents fc88359 + 7b9b2cd commit 030fd2c
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 030fd2c

Please sign in to comment.