# elegant-logging **Repository Path**: obs-thresh/elegant-logging ## Basic Information - **Project Name**: elegant-logging - **Description**: 优雅记录日志 实现 https://tech.meituan.com/2021/09/16/operational-logbook.html - **Primary Language**: Java - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-02-17 - **Last Updated**: 2023-02-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 使用方法 开启日志注解 @EnableElegantLogger(serviceId = "applicationName") 在方法上 @ElegantLogger 注解 ElegantLoggerContext.putVariable(name,value); 添加变量 # 规则说明 1. {#参数名} 直接获取方法上的参数,或者主动 putVariable 的参数值 2. {#参数名.参数名} 获取参数对象属性 3. {#_ret} 获取返回值 4. {#_errorMsg} 获取方法异常信息 5. {$v} 定义的常量 定义的常量 6. {@method(#v)} 执行是实现CustomParseFunction,并标有 @CustomFunction 注解的方法 7. {@bean.method(#v)} 执行spring bean 方法的调用(返回值必须是string 或者 void) # 扩展点 1. 系统常量扩展 实现 ConstantContainer 2. 自定义函数扩展 实现 CustomParseFunction 3. 日志操作扩展 实现 OperateLoggerCreator 4. 操作用户扩展 实现 OperatorGetter