tomcat日志格式调整为json

编辑 server.xml 找到里面的 host 对应的 log pattern,调整为如下格式:

tomcat日志格式调整为json_第1张图片

{"clientip":"%h","ClientUser":"%l","authenticated":"%u","AccessTime":"%t","method":"%r","status":"%s","SendBytes":"%b","Query?string":"%q","partner":"%{Referer}i","AgentVersion":"%{User-Agent}i"}

你可能感兴趣的:(tomcat,json,java)