public class DefaultLogger extends AutomaticBean implements AuditListener
XMLLogger
AutomaticBean.OutputStreamOptions
Modifier and Type | Field and Description |
---|---|
static String |
ADD_EXCEPTION_MESSAGE
A key pointing to the add exception
message in the "messages.properties" file.
|
static String |
AUDIT_FINISHED_MESSAGE
A key pointing to the finished audit
message in the "messages.properties" file.
|
static String |
AUDIT_STARTED_MESSAGE
A key pointing to the started audit
message in the "messages.properties" file.
|
Constructor and Description |
---|
DefaultLogger(OutputStream outputStream,
AutomaticBean.OutputStreamOptions outputStreamOptions)
Creates a new
DefaultLogger instance. |
DefaultLogger(OutputStream infoStream,
AutomaticBean.OutputStreamOptions infoStreamOptions,
OutputStream errorStream,
AutomaticBean.OutputStreamOptions errorStreamOptions)
Creates a new
DefaultLogger instance. |
DefaultLogger(OutputStream infoStream,
AutomaticBean.OutputStreamOptions infoStreamOptions,
OutputStream errorStream,
AutomaticBean.OutputStreamOptions errorStreamOptions,
AuditEventFormatter messageFormatter)
Creates a new
DefaultLogger instance. |
Modifier and Type | Method and Description |
---|---|
void |
addError(AuditEvent event)
Print an Emacs compliant line on the error stream.
|
void |
addException(AuditEvent event,
Throwable throwable)
Notify that an exception happened while performing audit.
|
void |
auditFinished(AuditEvent event)
Notify that the audit is finished.
|
void |
auditStarted(AuditEvent event)
Notify that the audit is about to start.
|
void |
fileFinished(AuditEvent event)
Notify that audit is finished on a specific file.
|
void |
fileStarted(AuditEvent event)
Notify that audit is about to start on a specific file.
|
protected void |
finishLocalSetup()
Provides a hook to finish the part of this component's setup that
was not handled by the bean introspection.
|
configure, contextualize, getConfiguration, setupChild
public static final String ADD_EXCEPTION_MESSAGE
public static final String AUDIT_STARTED_MESSAGE
public static final String AUDIT_FINISHED_MESSAGE
public DefaultLogger(OutputStream outputStream, AutomaticBean.OutputStreamOptions outputStreamOptions)
DefaultLogger
instance.outputStream
- where to log audit eventsoutputStreamOptions
- if CLOSE
that should be closed in auditFinished()public DefaultLogger(OutputStream infoStream, AutomaticBean.OutputStreamOptions infoStreamOptions, OutputStream errorStream, AutomaticBean.OutputStreamOptions errorStreamOptions)
DefaultLogger
instance.infoStream
- the OutputStream
for info messages.infoStreamOptions
- if CLOSE
info should be closed in auditFinished()errorStream
- the OutputStream
for error messages.errorStreamOptions
- if CLOSE
error should be closed in auditFinished()public DefaultLogger(OutputStream infoStream, AutomaticBean.OutputStreamOptions infoStreamOptions, OutputStream errorStream, AutomaticBean.OutputStreamOptions errorStreamOptions, AuditEventFormatter messageFormatter)
DefaultLogger
instance.infoStream
- the OutputStream
for info messagesinfoStreamOptions
- if CLOSE
info should be closed in auditFinished()errorStream
- the OutputStream
for error messageserrorStreamOptions
- if CLOSE
error should be closed in auditFinished()messageFormatter
- formatter for the log message.IllegalArgumentException
- if stream options are nullprotected void finishLocalSetup()
AutomaticBean
The default implementation does nothing.
finishLocalSetup
in class AutomaticBean
public void addError(AuditEvent event)
addError
in interface AuditListener
event
- the event detailsAuditListener
public void addException(AuditEvent event, Throwable throwable)
AuditListener
addException
in interface AuditListener
event
- the event detailsthrowable
- details of the exceptionpublic void auditStarted(AuditEvent event)
AuditListener
auditStarted
in interface AuditListener
event
- the event detailspublic void auditFinished(AuditEvent event)
AuditListener
auditFinished
in interface AuditListener
event
- the event detailspublic void fileStarted(AuditEvent event)
AuditListener
fileStarted
in interface AuditListener
event
- the event detailspublic void fileFinished(AuditEvent event)
AuditListener
fileFinished
in interface AuditListener
event
- the event detailsCopyright © 2001–2020. All rights reserved.