在/etc/rsyslog.d/文件中,我有以下内容:
local3.* /var/log/mylog.log
当我login到这个设施时,logging的时间戳看起来像这样:
Apr 27 21:12:20 hostname msg
我如何设置它们,使它们看起来像这样呢?
2014-04-27T21:12:20 hostname msg
这可以通过注释掉/etc/rsyslog.conf
的以下行来实现:
# # Use traditional timestamp format. # To enable high precision timestamps, comment out the following line. # $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
日志格式现在看起来像这样:
2014-04-29T20:41:36.366613+01:00 hostname msg