Skip to content

Commit

Permalink
change @timestamp to use ofEpochMilli
Browse files Browse the repository at this point in the history
  • Loading branch information
idohalevi committed Aug 29, 2018
1 parent 7d9b952 commit 30be8e8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/io/logz/logback/LogzioLogbackAppender.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.io.File;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
Expand Down Expand Up @@ -260,7 +261,7 @@ private JsonObject formatMessageAsJson(ILoggingEvent loggingEvent) {
loggingEvent.getMDCPropertyMap().forEach(logMessage::addProperty);
}

logMessage.addProperty(TIMESTAMP, new Date(loggingEvent.getTimeStamp()).toInstant().toString());
logMessage.addProperty(TIMESTAMP, Instant.ofEpochMilli(loggingEvent.getTimeStamp()).toString());
logMessage.addProperty(LOGLEVEL,loggingEvent.getLevel().levelStr);

if (loggingEvent.getMarker() != null) {
Expand Down

0 comments on commit 30be8e8

Please sign in to comment.