Skip to content

Commit

Permalink
Make LoggingHandler.logEntryFor extensible
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Creech committed Jul 30, 2022
1 parent 85b3ebd commit 6b511fb
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ public void publish(LogRecord record) {
}
LogEntry logEntry;
try {
logEntry = logEntryFor(record);
logEntry = logEntryFor(record).build();
} catch (Exception ex) {
getErrorManager().error(null, ex, ErrorManager.FORMAT_FAILURE);
return;
Expand Down Expand Up @@ -343,7 +343,7 @@ private MonitoredResource getMonitoredResource() {
return null;
}

private LogEntry logEntryFor(LogRecord record) throws Exception {
protected LogEntry.Builder logEntryFor(LogRecord record) throws Exception {
String payload = getFormatter().format(record);
Level level = record.getLevel();
LogEntry.Builder builder =
Expand All @@ -360,7 +360,7 @@ private LogEntry logEntryFor(LogRecord record) throws Exception {
for (LoggingEnhancer enhancer : enhancers) {
enhancer.enhanceLogEntry(builder);
}
return builder.build();
return builder;
}

@Override
Expand Down

0 comments on commit 6b511fb

Please sign in to comment.