Skip to content

Commit

Permalink
Adds some more logging (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Nov 20, 2023
1 parent 590e714 commit 54b7ec1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/teragrep/jla_05/RelpAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ private void disconnect() throws IOException, TimeoutException {
}
try {
this.relpConnection.disconnect();
System.out.printf("Disconnected from <[%s]>:<[%s]>%n", relpAddress, relpPort);
} catch (IllegalStateException | IOException | java.util.concurrent.TimeoutException e) {
System.out.printf("RelpAppender.disconnect exception: <%s>%n", e.getMessage());
}
Expand All @@ -167,6 +168,7 @@ private void connect() {
this.relpConnection.setReadTimeout(this.getReadTimeout());
this.relpConnection.setWriteTimeout(this.getWriteTimeout());
this.connected = this.relpConnection.connect(this.getRelpAddress(), this.getRelpPort());
System.out.printf("Connected to <[%s]>:<[%s]>%n", relpAddress, relpPort);
} catch (Exception e) {
System.out.printf("RelpAppender.connect exception: <%s>%n", e.getMessage());
}
Expand Down Expand Up @@ -241,6 +243,7 @@ protected void append(final LoggingEvent event) {
batch.retryAllFailed();
try {
reconnect();
System.out.printf("Reconnected to <[%s]>:<[%s]>%n", relpAddress, relpPort);
} catch (IOException | TimeoutException e) {
System.out.printf("RelpAppender.flush.reconnect exception: <%s>%n", e.getMessage());
}
Expand Down

0 comments on commit 54b7ec1

Please sign in to comment.