springboot 启动器 printparam-spring-boot-starter

码农软件 · 软件分类 · J2EE框架 · 2019-03-26 09:44:39

软件介绍

springboot启动器,自动在日志中打印输入输出参数,快捷方便,无需任何配置项,依赖少,开箱即用。

无中文乱码,可设置拦截路径和排除路径,可配置是否打印输入和输出。
可以用于测试和开发环境排除bug查找问题。也可以直接用于生产环境记录请求。

使用方法:

1.clone代码到本地

git clone git@gitee.com:sjlian/printparam-spring-boot-starter.git

2.安装到本地maven库,cd 到项目目录下

cd printparam-spring-boot-starter
maven install

3.引入到springboot项目依赖。

 <dependency>
           <groupId>com.github.printparam</groupId>
           <artifactId>printparam-spring-boot-starter</artifactId>
           <version>0.0.1-SNAPSHOT</version>
      </dependency>

4.可选,配置参数

print-param.enableInputParam=true 是否在日志中打印输入信息,默认true
print-param.enableOutputResult=false  是否在日志中打印输出信息,默认false
print-param.filterIncludePattern=/*  拦截哪些url进行日志打印 默认/*表示全部拦截,正则表达式,建议只拦截接口访问数据如/api/*
print-param.filterExcludePattern=(/webjars/.*|/css/.*|/images/.*|/fonts/.*|/js/.*)  正则表达式描述不拦截哪些url打印日志,默认如左

5.日志输入格式如下:

对于request:
    uri表示请求接口
    header表示请求头
    form是表单数据
    body是json数据
对于response:
    return data表示返回数据
    
request uri:/api/user1/add
request header:{Origin=http://localhost:8081, Accept=*/*, Connection=keep-alive, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36, Referer=http://localhost:8081/api/swagger-ui.html, Host=localhost:8081, Accept-Encoding=gzip, deflate, br, Accept-Language=zh-CN,zh;q=0.9, Content-Length=34, Content-Type=application/json}
request form:{}
request body:{  "age": 26,  "name": "hello"}
response return data:{"code":0,"message":"success","url":null,"data":{"id":null,"name":"hello","age":26,"version":null}}
request uri:/api/user1/add
request header:{Origin=http://localhost:8081, Accept=*/*, Connection=keep-alive, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36, Referer=http://localhost:8081/api/swagger-ui.html, Host=localhost:8081, Accept-Encoding=gzip, deflate, br, Accept-Language=zh-CN,zh;q=0.9, Content-Length=35, Content-Type=application/json}
request form:{}
request body:{  "age": 16,  "name": "张三"}
response return data:{"code":0,"message":"success","url":null,"data":{"id":null,"name":"张三","age":16,"version":null}}
request uri:/api/user1/get/1
request header:{Accept=*/*, Connection=keep-alive, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36, Referer=http://localhost:8081/api/swagger-ui.html, Host=localhost:8081, Accept-Encoding=gzip, deflate, br, Accept-Language=zh-CN,zh;q=0.9}
request form:{}
request body:
response return data:{"code":0,"message":"success","url":null,"data":null}
request uri:/api/user1/list
request header:{Accept=*/*, Connection=keep-alive, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36, Referer=http://localhost:8081/api/swagger-ui.html, Host=localhost:8081, Accept-Encoding=gzip, deflate, br, Accept-Language=zh-CN,zh;q=0.9}
request form:{}
request body:
response return data:{"code":0,"message":"success","url":null,"data":[]}
request uri:/api/demo/getHello
request header:{Accept=*/*, Connection=keep-alive, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36, Referer=http://localhost:8081/api/swagger-ui.html, Host=localhost:8081, Accept-Encoding=gzip, deflate, br, Accept-Language=zh-CN,zh;q=0.9}
request form:{}
request body:
response return data:hello

本文地址:https://codercto.com/soft/d/2178.html

以奋斗者为本

以奋斗者为本

黄卫伟 / 中信出版社 / 2014-11-1 / 68.00元

《以奋斗者为本:华为公司人力资源管理纲要》传承于《华为公司基本法》,华为管理层25年人力资源管理思想精髓,5年整理,华为公司内训教材,首次大公开!作为华为公司内部培训教材,原汁原味,是继《华为基本法》之后华为的标志性著作,对国内外企业管理者&研究者具有高度的研究及借鉴价值。《以奋斗者为本:华为公司人力资源管理纲要》由华为公司首席管理科学家主编,华为高管及顾问参与编著,华为管理层25年实践,权威出品......一起来看看 《以奋斗者为本》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器