Skip to content

kiss4u/dilog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dilog

简介

一个将Java方法入参及结果快速打印到日志的组件

使用步骤

1、添加@EnableSysLog

启动类上使用@EnableSysLog开启日志功能
@EnableSysLog
public class Application {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(Application.class, args);
    }
}

2、添加@SysLog

开启打印
@SysLog
public List<String> getList(String a, int b) {
    return new ArrayList();
}
打印第n个参数
@SysLog(param = "#p2", performance = true)
public List<String> getList(UserInfo userInfo) {
    return new ArrayList();
}
打印对象参数内属性
@SysLog(param = "#userInfo.name + #userInfo.sex", sizeLimit = 50, performance = true)
public List<String> getList(UserInfo userInfo) {
    return new ArrayList();
}
@SysLog(param = "#userInfo.workList", performance = true)
public List<String> getList(UserInfo userInfo) {
    return new ArrayList();
}

@SysLog属性表

属性 默认值 说明
logKey 方法名 指定缓存方法名
param 全部入参 参数输出范围
successOn true 是否打印成功日志
success 未定义 成功日志输出格式
sizeLimit 20 结果集输出数量
failOn true 是否打印失败日志
fail 未定义 失败日志输出格式
group default 日志分组
operator 未定义 操作人
performance false 是否打印性能指标

About

A component for Java method input and result printing to logs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages