Management of Java-developed logs using Spring's AOP

Source: Internet
Author: User

There are many kinds of log management in Java development. I usually use a filter or a spring interceptor for log processing. If the filter is simpler, just intercept all the. Do commits, and then get the action's commit path to get a call to each method. The log is then logged. The advantage of using filters is that you can selectively filter some methods and log logs. But it's a little cumbersome to implement.


Another is the use of spring's AOP. This approach is very simple to implement, as long as the configuration file can be configured. This way, however, intercepts every action on the action. Make it less efficient. But to do a detailed log this method is still very good. Let me explain how to use spring AOP for logging.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.