Skip to content

Commit

Permalink
Merge pull request #858 from newrelic/refactor-log-level
Browse files Browse the repository at this point in the history
Refactor log.level attribute to level
  • Loading branch information
jasonjkeller authored May 19, 2022
2 parents 103d81c + 18f72b3 commit bbd4210
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class AgentUtil {
// Log message attributes
public static final String MESSAGE = "message";
public static final String TIMESTAMP = "timestamp";
public static final String LOG_LEVEL = "log.level";
public static final String LEVEL = "level";
public static final String UNKNOWN = "UNKNOWN";
// Linking metadata attributes used in blob
private static final String BLOB_PREFIX = "NR-LINKING";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class AgentUtil {
// Log message attributes
public static final String MESSAGE = "message";
public static final String TIMESTAMP = "timestamp";
public static final String LOG_LEVEL = "log.level";
public static final String LEVEL = "level";
public static final String UNKNOWN = "UNKNOWN";
// Linking metadata attributes used in blob
private static final String BLOB_PREFIX = "NR-LINKING";
Expand Down Expand Up @@ -61,9 +61,9 @@ public static void recordNewRelicLogEvent(LogEvent event) {
if (level != null) {
String levelName = level.name();
if (levelName.isEmpty()) {
logEventMap.put(LOG_LEVEL, UNKNOWN);
logEventMap.put(LEVEL, UNKNOWN);
} else {
logEventMap.put(LOG_LEVEL, levelName);
logEventMap.put(LEVEL, levelName);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class AgentUtil {
// Log message attributes
public static final String MESSAGE = "message";
public static final String TIMESTAMP = "timestamp";
public static final String LOG_LEVEL = "log.level";
public static final String LEVEL = "level";
public static final String UNKNOWN = "UNKNOWN";
// Linking metadata attributes used in blob
private static final String BLOB_PREFIX = "NR-LINKING";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class AgentUtil {
// Log message attributes
public static final String MESSAGE = "message";
public static final String TIMESTAMP = "timestamp";
public static final String LOG_LEVEL = "log.level";
public static final String LEVEL = "level";
public static final String UNKNOWN = "UNKNOWN";
// Linking metadata attributes used in blob
private static final String BLOB_PREFIX = "NR-LINKING";
Expand Down Expand Up @@ -53,9 +53,9 @@ public static void recordNewRelicLogEvent(String message, long timeStampMillis,
logEventMap.put(TIMESTAMP, timeStampMillis);

if (level.toString().isEmpty()) {
logEventMap.put(LOG_LEVEL, UNKNOWN);
logEventMap.put(LEVEL, UNKNOWN);
} else {
logEventMap.put(LOG_LEVEL, level);
logEventMap.put(LEVEL, level);
}

AgentBridge.getAgent().getLogSender().recordLogEvent(logEventMap);
Expand Down

0 comments on commit bbd4210

Please sign in to comment.