Java Doc for CastorAppender.java in  » Database-ORM » castor » log4j » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » castor » log4j 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


log4j.CastorAppender

CastorAppender
final public class CastorAppender extends AppenderSkeleton (Code)
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.
author:
   Holger West




Constructor Summary
public  CastorAppender()
     Default constructor.

Method Summary
public synchronized  voidappend(LoggingEvent event)
     Adds the event to the buffer.
public  voidclose()
     Closes the appender, flushing the buffer first then closing the query and database if it is still open.
public  voidfinalize()
     Closes the appender before disposal.
public static  voidflush()
     When the program has ended all logger instances are destroyed.
public  intgetBufferSize()
     Get the size of the buffer.
public  intgetColumnWidthClass()
     Get the column width for class information.
public  intgetColumnWidthMessage()
     Get the column width for message information.
public  intgetColumnWidthStackTrace()
     Get the column width for stack trace information.
public  intgetColumnWidthThread()
     Get the column width for tread information.
public  StringgetDatabaseName()
     Get the name of the database.
public  StringgetDuplicateCount()
    
public  booleanrequiresLayout()
     CastorAppender don't requires a layout.
public  voidsetBufferSize(int newBufferSize)
     Set the size of the buffer.
public  voidsetColumnWidthClass(int columWidth)
     Set the column width for class information.
public  voidsetColumnWidthMessage(int columWidth)
     Set the column width for message information.
public  voidsetColumnWidthStackTrace(int columWidth)
     Set the column width for stack trace information.
public  voidsetColumnWidthThread(int columWidth)
     Set the column width for thread information.
public  voidsetDatabaseName(String name)
     Set the name of the database.
public  voidsetDuplicateCount(String duplicateCount)
     Set duplicate count.


Constructor Detail
CastorAppender
public CastorAppender()(Code)
Default constructor.




Method Detail
append
public synchronized void append(LoggingEvent event)(Code)
Adds the event to the buffer. When full the buffer is flushed.
Parameters:
  event - The event to be logged.



close
public void close()(Code)
Closes the appender, flushing the buffer first then closing the query and database if it is still open.



finalize
public void finalize()(Code)
Closes the appender before disposal.



flush
public static void flush()(Code)
When the program has ended all logger instances are destroyed. To save all data which are still in the buffer, this method must be called. It saves all data from all registered CastorAppender.
As an alternative org.apache.log4j.LogManager.shutdown() can be called.



getBufferSize
public int getBufferSize()(Code)
Get the size of the buffer. The size of the buffer.



getColumnWidthClass
public int getColumnWidthClass()(Code)
Get the column width for class information. The column width for class information.



getColumnWidthMessage
public int getColumnWidthMessage()(Code)
Get the column width for message information. The column width for message information.



getColumnWidthStackTrace
public int getColumnWidthStackTrace()(Code)
Get the column width for stack trace information. The column width for stack trace information.



getColumnWidthThread
public int getColumnWidthThread()(Code)
Get the column width for tread information. The column width for thread information.



getDatabaseName
public String getDatabaseName()(Code)
Get the name of the database. Name of the database.



getDuplicateCount
public String getDuplicateCount()(Code)
Is duplicate count enabled? true if duplicate count is enabled, otherwisefalse.



requiresLayout
public boolean requiresLayout()(Code)
CastorAppender don't requires a layout. true if this appender require a layout, otherwisefalse.



setBufferSize
public void setBufferSize(int newBufferSize)(Code)
Set the size of the buffer.
Parameters:
  newBufferSize - New size of the buffer.



setColumnWidthClass
public void setColumnWidthClass(int columWidth)(Code)
Set the column width for class information.
Parameters:
  columWidth - The column width for class information.



setColumnWidthMessage
public void setColumnWidthMessage(int columWidth)(Code)
Set the column width for message information.
Parameters:
  columWidth - The column width for message information.



setColumnWidthStackTrace
public void setColumnWidthStackTrace(int columWidth)(Code)
Set the column width for stack trace information.
Parameters:
  columWidth - The column width for stack trace information.



setColumnWidthThread
public void setColumnWidthThread(int columWidth)(Code)
Set the column width for thread information.
Parameters:
  columWidth - The column width for thread information.



setDatabaseName
public void setDatabaseName(String name)(Code)
Set the name of the database.
Parameters:
  name - Name of the database.



setDuplicateCount
public void setDuplicateCount(String duplicateCount)(Code)
Set duplicate count.
Parameters:
  duplicateCount - Should duplicate count be enabled?



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.