public class DefaultLogger extends AutomaticBean implements AuditListener
XMLLogger
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,
boolean closeStreamsAfterUse)
Creates a new
DefaultLogger instance. |
DefaultLogger(OutputStream infoStream,
boolean closeInfoAfterUse,
OutputStream errorStream,
boolean closeErrorAfterUse)
Creates a new
DefaultLogger instance. |
DefaultLogger(OutputStream infoStream,
boolean closeInfoAfterUse,
OutputStream errorStream,
boolean closeErrorAfterUse,
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.
|
configure, contextualize, finishLocalSetup, 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, boolean closeStreamsAfterUse)
DefaultLogger
instance.outputStream
- where to log infos and errorscloseStreamsAfterUse
- if oS should be closed in auditFinished()public DefaultLogger(OutputStream infoStream, boolean closeInfoAfterUse, OutputStream errorStream, boolean closeErrorAfterUse)
DefaultLogger
instance.infoStream
- the OutputStream
for info messages.closeInfoAfterUse
- auditFinished should close infoStream.errorStream
- the OutputStream
for error messages.closeErrorAfterUse
- auditFinished should close errorStreampublic DefaultLogger(OutputStream infoStream, boolean closeInfoAfterUse, OutputStream errorStream, boolean closeErrorAfterUse, AuditEventFormatter messageFormatter)
DefaultLogger
instance.infoStream
- the OutputStream
for info messagescloseInfoAfterUse
- auditFinished should close infoStreamerrorStream
- the OutputStream
for error messagescloseErrorAfterUse
- auditFinished should close errorStreammessageFormatter
- formatter for the log message.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-2017. All Rights Reserved.