|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.util.AuditLogger
public class AuditLogger
Used by various services to generate audit logs which can be useful for auditing, debugging and other logly necessities. The audit logger automatically rolls over its logs at midnight to facilitate the collection, processing and possible archiving of the logs.
| Field Summary | |
|---|---|
protected SimpleDateFormat |
_dayFormat
Used to format log file suffixes. |
protected String |
_dayStamp
The daystamp of the log file we're currently writing to. |
protected SimpleDateFormat |
_format
Used to format timestamps. |
protected FieldPosition |
_fpos
Annoying parameter required by the Format.format() method that appends to a string buffer. |
protected File |
_logPath
The path to our log file. |
protected PrintWriter |
_logWriter
We actually write to this feller here. |
protected Interval |
_rollover
The interval that rolls over the log file. |
protected Throttle |
_throttle
Suppress freakouts if our log file becomes hosed. |
protected int |
_throttled
Used to count the number of throttled messages for reporting. |
protected static String |
TIMESTAMP_FORMAT
Timestamp format used on all log messages. |
protected static int |
TIMESTAMP_LENGTH
The length of the timestamp format. |
| Constructor Summary | |
|---|---|
AuditLogger(File fullpath)
Creates an audit logger that logs to the specified file. |
|
AuditLogger(File path,
String filename)
Creates an audit logger that logs to the specified file. |
|
| Method Summary | |
|---|---|
protected void |
checkRollOver()
Check to see if it's time to roll over the log file. |
void |
close()
Closes this audit log (generally only done when the server is shutting down. |
void |
log(String message)
Writes the supplied message to the log, prefixed by a date and timestamp. |
protected void |
openLog(boolean freakout)
Opens our log file, sets up our print writer and writes a message to it indicating that it was opened. |
protected void |
scheduleNextRolloverCheck()
Schedule the next check to see if we should roll the logs over. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Interval _rollover
protected File _logPath
protected PrintWriter _logWriter
protected Throttle _throttle
protected int _throttled
protected String _dayStamp
protected SimpleDateFormat _dayFormat
protected SimpleDateFormat _format
protected FieldPosition _fpos
protected static final String TIMESTAMP_FORMAT
protected static final int TIMESTAMP_LENGTH
| Constructor Detail |
|---|
public AuditLogger(File path,
String filename)
public AuditLogger(File fullpath)
| Method Detail |
|---|
public void log(String message)
public void close()
protected void openLog(boolean freakout)
protected void checkRollOver()
protected void scheduleNextRolloverCheck()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||