public class AuditLogFileWriter extends Thread implements AuditEventListener, AuditEventWriter
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
static String |
VERSION |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
AuditLogFileWriter(File dir,
boolean hostBased,
int logLevel) |
AuditLogFileWriter(File dir,
int logLevel,
String groupBy)
This constructor creates a new instance of this class which writes events to
several files grouped by a request-property that is given by
groupBy. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(AuditEvent evt) |
void |
add(Collection<AuditEvent> evts) |
void |
addAlias(String alias,
String server)
This method lets you specify an alias for a webserver so that
events having this alias in their
Host:-header will
be written to the same file as the ones with the server-name in
the Host-header. |
void |
addEventListener(AuditEventListener listener) |
void |
addEvents(Collection<AuditEvent> events) |
void |
close() |
void |
eventArrived(AuditEvent evt)
this will block if the queue is full !
|
void |
eventsArrived(Collection<AuditEvent> events)
This method is called for notifying the listener of arrival of
several events in a block.
|
int |
eventsPending() |
String[] |
getColumnNames() |
String |
getFile() |
double[] |
getStatistics()
Returns the number of events written since the last
call of this method.
|
boolean |
hasEventsPending() |
int |
left() |
int |
length() |
void |
run() |
void |
setSteadyWriter(boolean b)
A writer not being steady just writes it queue on disk and exits.
|
void |
writeEvent(AuditEvent evt) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic static final String VERSION
public AuditLogFileWriter(File dir, int logLevel, String groupBy)
groupBy.dir - The basic directory where the files are created.logLevel - A log-level for debugging.groupBy - The name of the property by which events should by grouped.public AuditLogFileWriter(File dir, boolean hostBased, int logLevel)
public void writeEvent(AuditEvent evt) throws IOException
writeEvent in interface AuditEventWriterIOExceptionpublic void eventArrived(AuditEvent evt)
eventArrived in interface EventListener<AuditEvent>eventArrived in interface AuditEventListenerevt - The event which arrived.public void add(AuditEvent evt)
public void add(Collection<AuditEvent> evts)
public void addEventListener(AuditEventListener listener)
public double[] getStatistics()
public String[] getColumnNames()
public String getFile()
public void addAlias(String alias, String server)
Host:-header will
be written to the same file as the ones with the server-name in
the Host-header.alias - server - public boolean hasEventsPending()
public int eventsPending()
public void eventsArrived(Collection<AuditEvent> events)
AuditEventListenerAuditEventListener.eventArrived(AuditEvent) for each of the given
events, but may be handled in a more efficient way by implementations
capable of processing blocks of events.eventsArrived in interface AuditEventListenerevents - The block of events arrived.public void addEvents(Collection<AuditEvent> events)
public int length()
public int left()
public void setSteadyWriter(boolean b)
b - public void close()
Copyright © 2015 jwall.org. All Rights Reserved.