spring/spirng boot添加fluent日志-aop
此项目以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的更多相关文章
- python添加fluent日志记录-aop
python添加fluent日志,aop实现 1.配置fluent相关信息 fluent_config.ini fluent_config.ini [fluent.aop] #is support f ...
- python添加fluent日志记录
istio默认会进行日志的记录,但是仅仅记录到服务.以及服务之间调用的信息,不记录业务日志. 如: 所以需要添加业务日志记录. 1.python引入package fluentmsgpack 2.代码 ...
- springboot添加fluent日志记录
istio默认会进行日志的记录,但是仅仅记录到服务.以及服务之间调用的信息,不记录业务日志. 如: 所以需要添加业务日志记录. 1.引入依赖 <dependency> <gr ...
- 2018-08-16 中文代码之Spring Boot添加基本日志
之前中文代码之Spring Boot实现简单REST服务的演示服务不知为何中止. 新开issue: 演示服务中止 · Issue #2 · program-in-chinese/programming ...
- Spring Boot 2.0 教程 | AOP 切面统一打印请求日志
欢迎关注微信公众号: 小哈学Java 文章首发于个人网站 https://www.exception.site/springboot/spring-boot-aop-web-request 本节中,您 ...
- Spring Boot 自定义注解,AOP 切面统一打印出入参请求日志
其实,小哈在之前就出过一篇关于如何使用 AOP 切面统一打印请求日志的文章,那为什么还要再出一篇呢?没东西写了? 哈哈,当然不是!原因是当时的实现方案还是存在缺陷的,原因如下: 不够灵活,由于是以所有 ...
- Spring Boot - Logback配置日志要考虑哪些因素
Spring Boot - Logback配置日志 出于性能等原因,Logback 目前是springboot应用日志的标配: 当然有时候在生产环境中也会考虑和三方中间件采用统一处理方式.@pdai ...
- spring boot整合slf4j-log日志
原文地址:https://blog.csdn.net/u011271894/article/details/75735915 版权声明:本文为博主原创文章,未经博主允许不得转载. https://bl ...
- Spring Boot 添加JSP支持【转】
Spring Boot 添加JSP支持 大体步骤: (1) 创建Maven web project: (2) 在pom.xml文件添加依赖: (3) ...
随机推荐
- (Unity4.7)assetbundle 坑爹总结
使用版本Unity4.7 一.关于依赖打包 1.当一个被打包的资源A引用了其他的资源B,并且没有被打成一个包时,要选用[BuildAssetBundleOptions.CollectDependenc ...
- Win8系统本地连接显示为网络2
Win8系统中,当改变了网络环境,本地连接就会被识别为网络2,网络3等: 如果在一个固定的网络环境中,需要修改此名称,可以打开注册表: [HKEY_LOCAL_MACHINE\SOFTWARE\Mic ...
- Android Monkey: “No activities found to run, monkey aborted”错误原因
用monkey测试app时,输入命令adb shell monkey -p com.example.test -v -500 发现报错, 错误输入: :Monkey: seed=13 count=5 ...
- 吴裕雄 python 爬虫(4)
import requests user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, li ...
- 配置IIS支持Json格式
配置iis支持.json格式的文件 原文地址:http://blog.eroad.info/iis-suport-json/ 在做easyUI的官方示例的时候 有的例子是直接读取的json文件,但是默 ...
- MySQL 5.7 使用原生JSON类型
首先回顾一下JSON的语法规则: 数据在键值对中, 数据由逗号分隔, 花括号保存对象, 方括号保存数组. 按照最简单的形式,可以用下面的JSON表示: {"NAME": " ...
- 用js实现九九乘法口诀两种方式
js实现九九乘法口诀两种方式: 第一种是用户输入一个数弹出所对应的乘法口诀: <script type="text/javascript"> function art( ...
- mac通过命令行获取证书和配置文件过期时间
背景:ios打包证书的profile配置文件过期了,导致以前已经打完的测试包不能安装.所以需要加上检测机制,在打包时提示证书是否将要过期,如果要过期了给出提示 方案: 1.查找profile配 ...
- Nginx高级应用之Location Url
基本配置 为了探究nginx的url配置规则,当然需要安装nginx.我使用了vagrant创建了一个虚拟环境的Ubuntu,通过apt-get安装nginx.这样就不会污染mac的软件环境.通过vr ...
- CentOS 下搭建Hudson
1.下载Hudson安装包 wget http://ftp.jaist.ac.jp/pub/eclipse/hudson/war/hudson-3.3.3.war 2.执行 java -jar hud ...