|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Thread
org.jwall.web.audit.io.AuditLogFileWriter
public class AuditLogFileWriter
This is a persistence-thread which listens for events and writes them to a file. Writing to a file can also be configured to create a file for each set of events grouped together by the value of the Host-header field.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static java.lang.String |
VERSION
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
AuditLogFileWriter(java.io.File dir,
boolean hostBased,
int logLevel)
|
|
AuditLogFileWriter(java.io.File dir,
int logLevel,
java.lang.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. |
|
| Method Summary | |
|---|---|
void |
add(AuditEvent evt)
|
void |
add(java.util.Collection<AuditEvent> evts)
|
void |
addAlias(java.lang.String alias,
java.lang.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(java.util.Collection<AuditEvent> events)
|
void |
close()
|
void |
eventArrived(AuditEvent evt)
this will block if the queue is full ! |
int |
eventsPending()
|
java.lang.String[] |
getColumnNames()
|
java.lang.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)
|
| Methods inherited from class java.lang.Thread |
|---|
activeCount, checkAccess, 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, yield |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String VERSION
| Constructor Detail |
|---|
public AuditLogFileWriter(java.io.File dir,
int logLevel,
java.lang.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(java.io.File dir,
boolean hostBased,
int logLevel)
| Method Detail |
|---|
public void run()
run in interface java.lang.Runnablerun in class java.lang.Thread
public void writeEvent(AuditEvent evt)
throws java.io.IOException
writeEvent in interface AuditEventWriterjava.io.IOExceptionpublic void eventArrived(AuditEvent evt)
eventArrived in interface AuditEventListenerpublic void add(AuditEvent evt)
public void add(java.util.Collection<AuditEvent> evts)
public void addEventListener(AuditEventListener listener)
public double[] getStatistics()
public java.lang.String[] getColumnNames()
public java.lang.String getFile()
public void addAlias(java.lang.String alias,
java.lang.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 addEvents(java.util.Collection<AuditEvent> events)
public int length()
public int left()
public void setSteadyWriter(boolean b)
b - public void close()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||