【发布时间】:2020-05-05 11:09:13
【问题描述】:
我使用 logback (logback-gelf vs.1.1.0) 来登录我的 Spring Boot 应用程序。它具有配置 xml 文件,我尝试在此配置文件中编写正则表达式来屏蔽密码。我这样写:
%replace(%msg){'(password...)(\d{6})(.)', '$1****$3'}
它与{"password":"123456"} 一起工作并给出输出{"password":"****"}。
但是,它不能用于:
{"client_id":["account"],"password":["111111"],"grant_type":["password"]}
我想做{"client_id":["account","password":["****"],"grant_type":["password"]}
我该怎么做?
【问题讨论】:
标签: regex logging logback spring-logback