标签:led user etc res action cal rsyslog 时间戳 syslog
默认的时间戳格式是Jul 14 13:30:01 localhost systemd: Starting Session 38 of user root.
看着不是很方便,现修改为以下格式
2018-07-14 13:32:57 desktop0 systemd: Starting System Logging Service...
修改 /etc/rsyslog.conf
# Use default timestamp format #$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat # 这行是原来的将它注释,添加下面两行 $template CustomFormat,"%$NOW% %TIMESTAMP:8:15% %HOSTNAME% %syslogtag% %msg%\n" $ActionFileDefaultTemplate CustomFormat
然后重启 rsyslog 服务
systemctl restart rsyslog.service
标签:led user etc res action cal rsyslog 时间戳 syslog
原文地址:http://blog.51cto.com/babyshen/2142254