@@ -13,15 +13,16 @@ public class LogEntry {
1313 private final String name ;
1414 private final String logtype ;
1515 private final long timestamp ;
16+ private final Map <String , Object > properties ; // Add custom fields
1617
1718 public LogEntry (String message , String applicationName , String name , String logtype , long timestamp ,
18- Map <String , Object > custom , boolean mergeCustomFields ) {
19+ Map <String , Object > properties , boolean mergeCustomFields ) {
1920 this .message = message ;
2021 this .applicationName = applicationName ;
2122 this .name = name ;
2223 this .logtype = logtype ;
2324 this .timestamp = timestamp ;
24-
25+ this . properties = properties ; // Initialize custom fields
2526 }
2627
2728 // Default constructor for Jackson
@@ -31,17 +32,20 @@ public LogEntry() {
3132 this .name = null ;
3233 this .logtype = null ;
3334 this .timestamp = 0L ;
35+ this .properties = null ; // Initialize custom fields
3436 }
3537
3638 @ JsonCreator
3739 public LogEntry (@ JsonProperty ("message" ) String message , @ JsonProperty ("applicationname" ) String applicationName ,
3840 @ JsonProperty ("name" ) String name , @ JsonProperty ("logtype" ) String logtype ,
39- @ JsonProperty ("timestamp" ) long timestamp ) {
41+ @ JsonProperty ("timestamp" ) long timestamp , @ JsonProperty ("custom" ) Map <String , Object > properties ) { // Add
42+
4043 this .message = message ;
4144 this .applicationName = applicationName ;
4245 this .name = name ;
4346 this .logtype = logtype ;
4447 this .timestamp = timestamp ;
48+ this .properties = properties ; // Initialize custom fields
4549 }
4650
4751 public String getMessage () {
@@ -63,4 +67,8 @@ public String getLogType() {
6367 public long getTimestamp () {
6468 return timestamp ;
6569 }
66- }
70+
71+ public Map <String , Object > getProperties () { // Add getter for custom
72+ return properties ;
73+ }
74+ }
0 commit comments