首页> 中文期刊> 《价值工程》 >基于Annotation的Spring AOP日志处理的设计与实现

基于Annotation的Spring AOP日志处理的设计与实现

         

摘要

系统维护和错误排查需要程序能自动的输出日志信息,将用户的操作记录下来.而日志本身不太可能是你开发的主程序的主要任务.如果能将“不可见的”、通用的日志代码注入主程序中,而保证自身业务逻辑的纯洁性,降低代码之间的耦合度,增加程序的灵活性和可重用性.本文使用Spring AOP的Annotation方式,写一个切面,并且指定切入的范围(切入点),当系统运行后,日志信息将可以自动输出或记录在指定的文件及数据库中.%System maintenance and errors troubleshooting need the program can automatically output log information and record the user's actions. But the log itself is unlikely to be your main tasks of the development of the main program. If the "invisible" and common logging code can be recorded into the main program, it will guarantee the purity of their business logic, reduce coupling between code, and increase program flexibility and reusability. This paper uses Annotation of Spring AOP to write a section, and specifies the range of cuts (starting point). When the system is running, log information will be output automatically or record in the specified files and database.

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号