此项目以aop的形式添加fluent 日志

sample介绍
spring-mvc-aop-helloworld 为spring mvc aop condition
toolcommontest 为spring boot aop condition 0.将项目打包上传maven私服 1.spring boot和spring 添加依赖
<dependency>
<groupId>com.taiyue.tool.common</groupId>
<artifactId>tool-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
2.添加application.properties
1)位置
spring boot添加到resources下
spring mvc添加到 WEB-INFO下classes文件夹下
2) 详情
#是否支持 fluent日志 false否 true是(默认)
#即aop注解总开关
fluent.aopStatus=true
#当前服务名称
project.name=toolcommontest
#fluent 连接信息
#非istio项目
fluent.url=192.168.181.99
fluent.port=30224
#istio项目
#fluent.url=fluentd-es.logging
#fluent.port=24224
3.上下文引入aop类
1)spring boot
启动类引入
@Import({ControllerProcessAop.class, DaoProcessAop.class, ServiceProcessAop.class})
2)spring
.xml
<context:component-scan base-package="com.taiyue.tool.common.process" />
<aop:aspectj-autoproxy proxy-target-class="true"/>
4.使用
1)aop添加fluent日志 spring boot/spring controller类添加注解@DinfoUrlTag
service类添加注解@DinfoServiceTag
dao类添加注解@DinfoDaoTag 注意:可以在application.properties中通过配置fluent.aopStatus统一控制aop生效与否 2)业务代码添加fluent日志 假如配置了application.properties可以直接通过FluentProperties.getLog()获取fluent服务对象。 如: FluentProperties.getLog().log("hello","testMethod","helloworld");
log方法详解: 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.事例代码
https://github.com/jiuchongxiao/fluent-aop.git

spring/spirng boot添加fluent日志-aop的更多相关文章

  1. python添加fluent日志记录-aop

    python添加fluent日志,aop实现 1.配置fluent相关信息 fluent_config.ini fluent_config.ini [fluent.aop] #is support f ...

  2. python添加fluent日志记录

    istio默认会进行日志的记录,但是仅仅记录到服务.以及服务之间调用的信息,不记录业务日志. 如: 所以需要添加业务日志记录. 1.python引入package fluentmsgpack 2.代码 ...

  3. springboot添加fluent日志记录

    istio默认会进行日志的记录,但是仅仅记录到服务.以及服务之间调用的信息,不记录业务日志. 如: 所以需要添加业务日志记录. 1.引入依赖 <dependency>     <gr ...

  4. 2018-08-16 中文代码之Spring Boot添加基本日志

    之前中文代码之Spring Boot实现简单REST服务的演示服务不知为何中止. 新开issue: 演示服务中止 · Issue #2 · program-in-chinese/programming ...

  5. Spring Boot 2.0 教程 | AOP 切面统一打印请求日志

    欢迎关注微信公众号: 小哈学Java 文章首发于个人网站 https://www.exception.site/springboot/spring-boot-aop-web-request 本节中,您 ...

  6. Spring Boot 自定义注解,AOP 切面统一打印出入参请求日志

    其实,小哈在之前就出过一篇关于如何使用 AOP 切面统一打印请求日志的文章,那为什么还要再出一篇呢?没东西写了? 哈哈,当然不是!原因是当时的实现方案还是存在缺陷的,原因如下: 不够灵活,由于是以所有 ...

  7. Spring Boot - Logback配置日志要考虑哪些因素

    Spring Boot - Logback配置日志 出于性能等原因,Logback 目前是springboot应用日志的标配: 当然有时候在生产环境中也会考虑和三方中间件采用统一处理方式.@pdai ...

  8. spring boot整合slf4j-log日志

    原文地址:https://blog.csdn.net/u011271894/article/details/75735915 版权声明:本文为博主原创文章,未经博主允许不得转载. https://bl ...

  9. Spring Boot 添加JSP支持【转】

    Spring Boot 添加JSP支持 大体步骤: (1)            创建Maven web project: (2)            在pom.xml文件添加依赖: (3)     ...

随机推荐

  1. Oracle Error

    1. TNS:listener does not currently know of service requested in connect descriptor 数据库连接出错

  2. 零基础用Docker部署微服务

    1. docker架构 这里的Client和DOCKER_HOST(docker server)都是在本地的,docker仓库Registry是在远程的: Client的docker命令通过Docke ...

  3. svn转git

    在Git Bash 中输入 git-svn clone http://devsvnread.uuzuonline.net/GOT_PRIVATE/server/ --no-metadata -T tr ...

  4. 解决python3.6的UnicodeEncodeError: 'gbk' codec can't encode character '\xbb' in position 28613: illegal multibyte sequence

    这是python3.6的print()函数自身有限制,不能完全打印所有的unicode字符. 主要的是windows下python的默认编码不是'utf-8',改一下python的默认编码成'utf- ...

  5. kali下的miranda工具只适合同一路由下使用

    在终端输入如下命令: miranda -v -i eth0 上面的命令是指定打开网卡eth0,返回结果如下: miranda提示输入开启upnp的主机,现在我们不知道哪台主机开启了upnp,输入命令“ ...

  6. sql语句where条件判断是否是相同的string时 原来不判断大小写

    SELECT * from api_check where api ="Worker" SELECT * from api_check where api ="worke ...

  7. hello world讲解1

    1. HelloWorld程序解析---------------------------------------------------------------------------------- ...

  8. 六、Prototype 原型设计模式

    需求:使用 new 生成实例需要指定类名,在不指定类的情况下生成实例 代码清单: 原型接口 Product: public interface Product extends Cloneable{ v ...

  9. php拓展

    https://github.com/phalcon/zephirhttp://blog.csdn.net/black_OX/article/details/43700707

  10. openstack(Pike 版)集群部署(二)--- Keystone 部署

    一.介绍 参照官网部署:https://docs.openstack.org/keystone/queens/install/ 继续上一博客进行部署:http://www.cnblogs.com/we ...