Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from marthursson/master
Browse files Browse the repository at this point in the history
Hook method to add custom data to JSON event
  • Loading branch information
tony19 committed Dec 21, 2014
2 parents 2a3da86 + eedebdf commit ef9f173
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,23 @@ protected Map toJsonMap(ILoggingEvent event) {
}
}

addCustomDataToJsonMap(map, event);
return map;
}

/**
* Override to add custom data to the produced JSON from the logging event.
* Useful if you e.g. want to include the parameter array as a separate json attribute.
*
* @param map the map for JSON serialization, populated with data corresponding to the
* configured attributes. Add new entries from the event to this map to have
* them included in the produced JSON.
* @param event the logging event to extract data from.
*/
protected void addCustomDataToJsonMap(Map<String, Object> map, ILoggingEvent event) {
// Nothing to do in default implementation
}

public boolean isIncludeLevel() {
return includeLevel;
}
Expand Down

0 comments on commit ef9f173

Please sign in to comment.