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

Hook method to add custom data to JSON event #8

Merged
merged 1 commit into from
Dec 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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