1+
12package com .newrelic .labs ;
23
34import java .util .Map ;
@@ -12,15 +13,19 @@ public class LogEntry {
1213 private final String applicationName ;
1314 private final String name ;
1415 private final String logtype ;
16+ private final String logger ;
17+ private final String severity ;
1518 private final long timestamp ;
1619 private final Map <String , Object > properties ; // Add custom fields
1720
18- public LogEntry (String message , String applicationName , String name , String logtype , long timestamp ,
19- Map <String , Object > properties , boolean mergeCustomFields ) {
21+ public LogEntry (String message , String applicationName , String name , String logtype , String loggername ,
22+ String loglevel , long timestamp , Map <String , Object > properties , boolean mergeCustomFields ) {
2023 this .message = message ;
2124 this .applicationName = applicationName ;
2225 this .name = name ;
2326 this .logtype = logtype ;
27+ this .logger = loggername ;
28+ this .severity = loglevel ;
2429 this .timestamp = timestamp ;
2530 this .properties = properties ; // Initialize custom fields
2631 }
@@ -31,19 +36,24 @@ public LogEntry() {
3136 this .applicationName = null ;
3237 this .name = null ;
3338 this .logtype = null ;
39+ this .logger = null ;
40+ this .severity = null ;
3441 this .timestamp = 0L ;
3542 this .properties = null ; // Initialize custom fields
3643 }
3744
3845 @ JsonCreator
3946 public LogEntry (@ JsonProperty ("message" ) String message , @ JsonProperty ("applicationname" ) String applicationName ,
4047 @ JsonProperty ("name" ) String name , @ JsonProperty ("logtype" ) String logtype ,
48+ @ JsonProperty ("logger" ) String logger , @ JsonProperty ("severity" ) String severity ,
4149 @ JsonProperty ("timestamp" ) long timestamp , @ JsonProperty ("custom" ) Map <String , Object > properties ) { // Add
4250
4351 this .message = message ;
4452 this .applicationName = applicationName ;
4553 this .name = name ;
4654 this .logtype = logtype ;
55+ this .logger = logger ;
56+ this .severity = severity ;
4757 this .timestamp = timestamp ;
4858 this .properties = properties ; // Initialize custom fields
4959 }
@@ -64,6 +74,14 @@ public String getLogType() {
6474 return logtype ;
6575 }
6676
77+ public String getLogger () {
78+ return logger ;
79+ }
80+
81+ public String getSeverity () {
82+ return severity ;
83+ }
84+
6785 public long getTimestamp () {
6886 return timestamp ;
6987 }
0 commit comments