org.castor.tools.log4j
public final class CastorAppender extends AppenderSkeleton
CastorAppender
provides sending log events to a database.
Each append call adds the LoggingEvent
to an ArrayList
buffer. When the buffer is filled each log event is saved to the database.
DatabaseName, BufferSize, ColumnWidthClass,
ColumnWidthThread, ColumnWidthMessage, ColumnWidthStackTrace and
DuplicateCount are configurable options in the standard log4j ways.
Version: $Id: TNSAddress.java,v 1.2 2006/08/08 14:42:48 holger Exp $
Constructor Summary | |
---|---|
CastorAppender()
Default constructor. |
Method Summary | |
---|---|
void | append(LoggingEvent event)
Adds the event to the buffer. |
void | close()
Closes the appender, flushing the buffer first then closing the query and database
if it is still open. |
void | finalize() Closes the appender before disposal. |
static void | flush()
When the program has ended all logger instances are destroyed. |
int | getBufferSize()
Get the size of the buffer.
|
int | getColumnWidthClass()
Get the column width for class information.
|
int | getColumnWidthMessage()
Get the column width for message information.
|
int | getColumnWidthStackTrace()
Get the column width for stack trace information.
|
int | getColumnWidthThread()
Get the column width for tread information.
|
String | getDatabaseName()
Get the name of the database.
|
String | getDuplicateCount()
Is duplicate count enabled?
|
boolean | requiresLayout()
CastorAppender don't requires a layout.
|
void | setBufferSize(int newBufferSize)
Set the size of the buffer.
|
void | setColumnWidthClass(int columWidth)
Set the column width for class information.
|
void | setColumnWidthMessage(int columWidth)
Set the column width for message information.
|
void | setColumnWidthStackTrace(int columWidth)
Set the column width for stack trace information.
|
void | setColumnWidthThread(int columWidth)
Set the column width for thread information.
|
void | setDatabaseName(String name)
Set the name of the database.
|
void | setDuplicateCount(String duplicateCount)
Set duplicate count.
|
Parameters: event The event to be logged.
CastorAppender
.
org.apache.log4j.LogManager.shutdown()
can be
called.Returns: The size of the buffer.
Returns: The column width for class information.
Returns: The column width for message information.
Returns: The column width for stack trace information.
Returns: The column width for thread information.
Returns: Name of the database.
Returns: true
if duplicate count is enabled, otherwise
false
.
Returns: true
if this appender require a layout, otherwise
false
.
Parameters: newBufferSize New size of the buffer.
Parameters: columWidth The column width for class information.
Parameters: columWidth The column width for message information.
Parameters: columWidth The column width for stack trace information.
Parameters: columWidth The column width for thread information.
Parameters: name Name of the database.
Parameters: duplicateCount Should duplicate count be enabled?