0

We want to write operation logs in our application for all the operation being made to DataBase. The operation log should contain the operation info(the data being "add/modify/delete") and the result of the operation(success/failure). Since there are more number of action classees, adding the code to write operation log in each action class looks difficult. So I thought of writing this part of code in the Servlet Filter. But I have a problem here, I need to know the operation status(success/failure) but this is not possible in the filter with out parsing the response object. But parsing the response object looks difficult. Can you suggest any alternative way to do this?

Thanks,

Chandra

4

2 回答 2

0

如果您的应用程序像 Spring 一样基于 AOP,那么您可以定义可以检查标准的方面,例如特定包的类、特定类型的方法(get/set/both)。使用这些方面,您可以添加日志记录。

于 2012-05-14T12:42:14.873 回答
0

我认为实现这一点的最佳方法是向 JDBC 驱动程序添加一些额外的日志记录。过去我使用过Log4JDBC项目。

于 2012-05-14T12:44:24.007 回答