2.5. 修改日志记录格式
您可以修改特定服务的日志记录的开头格式。这会直接传递给 Rsyslog 配置。
Red Hat OpenStack Platform (RHOSP)日志记录的默认格式为('^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2} [0-9]{2}(.0-9]+ [0-9]+)?(DEBUG|INFO|WARNING|ERROR) '。
流程
要添加一个用于解析日志记录开始的正则表达式,请在配置中添加
startmsg.regex:NovaComputeLoggingSource: tag: openstack.nova.compute file: /some/other/path/nova-compute.log startmsg.regex: "^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}(.[0-9]+ \\+[0-9]+)? [A-Z]+ \\([a-z]+\\)