Source code: http://git.oschina.net/openkoala/koala
Koala-Business submodule
Module division
Module name |
Function |
Koala-businesslog-API |
Core APIs of the Business Log System |
Koala-businesslog-impl |
Default Implementation of koala in the Business Log System |
Koala-businesslog-Web |
Business Log System Web module |
Koala-businesslog-acceptance-test |
The integration test of the Business Log system is also a ** example ** of the Business Log system. You can refer to this module for actual use. |
Sequence Chart
Class Diagram
Koala-businesslog-API module
Koala-business-impl Module
Vocabulary
Class Name |
Description |
Businesslogservletfilter |
Implement the filter interface, abstract the parent class, and define the abstract method beforefilter. |
Logfilter |
Inherit beforefilter and implement the beforefilter method. Set the user name and IP address |
Abstractbusinesslog |
Custom Business Log abstract parent class, including log and category Fields |
Defaultbusinesslog |
System Default Business Log entity class, including user name, IP address, and time |
Businesslogexporter |
Service Log export interface |
Businesslogexporterimpl |
The default business log export implementation class is saved to the database. |
Threadlocalbusinesslogcontext |
Local variable context of the thread to share data within the thread |
Businessloginterceptor |
AOP interceptor |
Businesslogthread |
Business Log thread execution class |
Groovyobjectclasscache |
Groovy object cache class |
Configconstant |
Constant type of system configuration |
Groovy considerations
Use groovy to implement logging of log templates instead of XML. The considerations are as follows:
1. It supports dynamic modification without restarting the service.
2. Using groovy does not bring much learning cost. You can simply write Java code.
3. in this way, you can obtain the associated query, for example, deptid In the method, but what I want in the log is deptname (for example, Architecture), then use groovy, you can easily use Java code to implement
4. It has syntax check. It is difficult to use xml configuration.
Koala Business Log System Design