|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.log4j.AppenderSkeleton
org.castor.tools.log4j.CastorAppender
The 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.
| Field Summary |
| Fields inherited from class org.apache.log4j.AppenderSkeleton |
closed, errorHandler, headFilter, layout, name, tailFilter, threshold |
| Constructor Summary | |
CastorAppender()
Default constructor. |
|
| Method Summary | |
void |
append(org.apache.log4j.spi.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. |
java.lang.String |
getDatabaseName()
Get the name of the database. |
java.lang.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(java.lang.String name)
Set the name of the database. |
void |
setDuplicateCount(java.lang.String duplicateCount)
Set duplicate count. |
| Methods inherited from class org.apache.log4j.AppenderSkeleton |
activateOptions, addFilter, clearFilters, doAppend, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public CastorAppender()
| Method Detail |
public static void flush()
CastorAppender.
org.apache.log4j.LogManager.shutdown() can be
called.
public void finalize()
public void close()
public void append(org.apache.log4j.spi.LoggingEvent event)
event - The event to be logged.public boolean requiresLayout()
true if this appender require a layout, otherwise
false.public void setBufferSize(int newBufferSize)
newBufferSize - New size of the buffer.public int getBufferSize()
public void setDatabaseName(java.lang.String name)
name - Name of the database.public java.lang.String getDatabaseName()
public void setColumnWidthClass(int columWidth)
columWidth - The column width for class information.public int getColumnWidthClass()
public void setColumnWidthThread(int columWidth)
columWidth - The column width for thread information.public int getColumnWidthThread()
public void setColumnWidthMessage(int columWidth)
columWidth - The column width for message information.public int getColumnWidthMessage()
public void setColumnWidthStackTrace(int columWidth)
columWidth - The column width for stack trace information.public int getColumnWidthStackTrace()
public void setDuplicateCount(java.lang.String duplicateCount)
duplicateCount - Should duplicate count be enabled?public java.lang.String getDuplicateCount()
true if duplicate count is enabled, otherwise
false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||