22
33import java .util .Map ;
44
5+ import com .fasterxml .jackson .annotation .JsonCreator ;
6+ import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
7+ import com .fasterxml .jackson .annotation .JsonProperty ;
8+
9+ @ JsonIgnoreProperties (ignoreUnknown = true )
510public class LogEntry {
611 private final String message ;
712 private final String applicationName ;
813 private final String name ;
914 private final String logtype ;
1015 private final long timestamp ;
1116
12-
1317 public LogEntry (String message , String applicationName , String name , String logtype , long timestamp ,
1418 Map <String , Object > custom , boolean mergeCustomFields ) {
1519 this .message = message ;
@@ -20,6 +24,26 @@ public LogEntry(String message, String applicationName, String name, String logt
2024
2125 }
2226
27+ // Default constructor for Jackson
28+ public LogEntry () {
29+ this .message = null ;
30+ this .applicationName = null ;
31+ this .name = null ;
32+ this .logtype = null ;
33+ this .timestamp = 0L ;
34+ }
35+
36+ @ JsonCreator
37+ public LogEntry (@ JsonProperty ("message" ) String message , @ JsonProperty ("applicationname" ) String applicationName ,
38+ @ JsonProperty ("name" ) String name , @ JsonProperty ("logtype" ) String logtype ,
39+ @ JsonProperty ("timestamp" ) long timestamp ) {
40+ this .message = message ;
41+ this .applicationName = applicationName ;
42+ this .name = name ;
43+ this .logtype = logtype ;
44+ this .timestamp = timestamp ;
45+ }
46+
2347 public String getMessage () {
2448 return message ;
2549 }
0 commit comments