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) ...
随机推荐
- python 验证码test
灰度化 #coding:utf8 import re import urllib import urllib2 import requests from PIL import Image import ...
- 创建maven项目前的准备工作
第二步: 在maven中的settings.xml文件中指定 2.1 本地仓库:计算机中一个文件夹,自己定义是哪个文件夹. 2.1 示例语法 <localRepository>D:/mav ...
- the type java.io.ObjectInputStream cannot be resolved. It is indirectly......
问题的原因: 配置tomcat7.0的时候自己设置了jre的版本1.8,而没有用myeclipse10自带的jre1.6,导致了出现了差错! 两种解决的办法: 1.点击windows--->pr ...
- 服务器安装pip
1. wget --no-check-certificate https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6. ...
- springcloud eureka.instance
1.在springcloud中服务的 Instance ID 默认值是: ${spring.cloud.client.hostname}:${spring.application.name}:${sp ...
- mysql数据库备份shell
sip=xxx.xxx.xxx.xxx user=user passwd=passwd back_path=/home/xxxxx/mysqlbak data_name=data_name date= ...
- python-ceilometerclient命令行(终结)
ceilometerclient入口 工程ceilometerclient shell.py中的main方法 ceilometerclient目录 --ceilometerclient --commo ...
- Centos新增group和user
新增group groupadd hadoop 新增用户 useradd -d /usr/hadoop -g hadoop -m hadoop 设置密码 passwd hadoop
- e-olymp Problem8352 Taxi
作为我在这个OJ玩了一下午的终结吧. 水题一道,阅读理解OJ. 传送门:点我 Taxi At the peak hour, three taxi buses drove up at the same ...
- .linearDrag on rigidbody / rigidbody2D in code?
it's rigidbody.drag not .linearDrag 这几天在做一个弹球的游戏,发现小球落下后不会自动停,测试后发现线性阻尼增加后可以 于是加了个触发器不停增加线性阻尼值 priva ...