4.6. 修改日志记录的格式
您可以修改特定服务的日志记录开始格式。这会直接传递给 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]+)?(调试|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]+\\)