SPRING/SPIRNG boot Add fluent log-aop

Source: Internet
Author: User
Tags aop

This project adds the fluent log as an AOP sample introduction Spring-mvc-aop-helloworld for spring MVC AOP conditiontoolcommontest for spring boot AOP Condition0. Package uploads to Maven 1.spring boot and spring add dependencies <dependency> <groupid>com.taiyue.tool.common</g    Roupid> <artifactId>tool-common</artifactId> <version>0.0.1-SNAPSHOT</version> </dependency>2. Add application.properties1) Location Spring boot Add to resources under Spring MVC Add to Web-info under Classes folder 2) Details # If fluent log is supported False no true is (default) #即aop注解总开关fluent. aopstatus=true# Current service Name project.name=toolcommontest#fluent connection Information #非istio Project Fluent.url=192.168.181.99fluent.port=30224#istio Project #fluent.url=fluentd-es.logging#fluent.port=242243. Context introduced in AOP Class 1) Spring Boot Launcher class introduces @import ({controllerprocessaop.class, Daoprocessaop.class, Serviceprocessaop.class}) 2) Spring.xml<context:component-scan base-package= "Com.taiyue.tool.common.process"/&GT;&LT;AOP:  Aspectj-autoproxy proxy-target-class= "true"/>4. Use 1) AOP to add fluent logs spring boot/spring      Controller class Add annotations @dinfourltag service class add annotations @dinfoservicetag DAO class add annotations @dinfodaotag Note: You can pass in Application.properties Over configuration Fluent.aopstatus Unified Control AOP effective or not 2) business code add fluent log if configured application.properties can be directly through the Fluentproperties.getlog ()   Gets the fluent service object.   such as: Fluentproperties.getlog (). log ("Hello", "TestMethod", "HelloWorld"); Log Method: Log (string tag, string key, Object value) log (string tag, string key, object value, long timestamp) log (string tag, map<string, object> data) log (String tag, map<string, object> data, long timestamp)
5. Case code
Https://github.com/jiuchongxiao/fluent-aop.git

SPRING/SPIRNG boot Add fluent log-aop

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.