public class Slf4jProcessor extends Object implements Processor, Reversible
The lines that are submitted to slf4j are prefixed with a configurable "audit marker" and the name of the audit stream as provided, or the default audit stream if none was provided.
If the underlying logger supports MDC, the following fields are stored in the MDC:
If so configured, then this processor will additionally include specific fields in the MDC map, making them directly available for further processing by the underlying logger.
This implementation supports storing specific Event fields in the MDC, either under their Event
field name, or through an "alias", which allows storing Event fields in the MDC using an alternative name.
| Constructor and Description |
|---|
Slf4jProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanUp()
This processor does not store any confidential information.
|
void |
init(CommonProperties pCommonProperties) |
Event |
process(Event event)
This method processes an event in the default audit stream.
|
Event |
process(Event event,
String auditStreamName)
This method processes an event in the provided audit stream.
|
Event |
process(Event event,
String auditStreamName,
ProcessingObjects processingObjects)
This method processes an event in the provided audit stream and includes a set of
ProcessingObjects. |
Event |
revert(Event event)
This processor does not alter the
Event. |
public final void init(CommonProperties pCommonProperties)
public final Event process(Event event) throws AuditException
See Audit.audit(Event).
See process(Event, String, ProcessingObjects).
process in interface Processorevent - The event to auditAuditException - when the audit operation fails (e.g. no machine ID could be obtained)public final Event process(Event event, String auditStreamName) throws AuditException
See Audit.audit(Event).
See process(Event, String, ProcessingObjects).
process in interface Processorevent - The event to auditauditStreamName - The audit stream to send events toAuditException - when the audit operation fails (e.g. no machine ID could be obtained)NullPointerException - When the auditStreamName or processingObjects are nullIllegalArgumentException - When auditStreamName is emptypublic final Event process(Event event, String auditStreamName, ProcessingObjects processingObjects) throws AuditException
ProcessingObjects.
process in interface Processorevent - The event to auditauditStreamName - The audit stream to send events toprocessingObjects - The processing objects available to the processorsAuditException - when the audit operation fails (e.g. the event already contains a machine ID,
or no machine ID could be obtained)NullPointerException - When the auditStreamName or processingObjects are nullIllegalArgumentException - When auditStreamName is emptypublic void cleanUp()
The implementation of this method does nothing.
public final Event revert(Event event) throws AuditException
Event.revert in interface Reversibleevent - The event to revert changes onAuditException - When the operation failsCopyright © 2015–2016 Michael Beiter