syslog配置
Posted xue0123
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了syslog配置相关的知识,希望对你有一定的参考价值。
syslog配置如下:
$ModLoad imuxsock # provides support for local system logging (e.g. via logger command) $ModLoad imjournal # provides access to the systemd journal $ModLoad imudp $UDPServerRun 514 $ModLoad imtcp $InputTCPServerRun 514 $WorkDirectory /var/lib/rsyslog $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat $IncludeConfig /etc/rsyslog.d/*.conf $OmitLocalLogging on $IMJournalStateFile imjournal.state *.info;mail.none;authpriv.none;cron.none /var/log/ authpriv.* /var/log/secure mail.* -/var/log/maillog cron.* /var/log/cron uucp,news.crit /var/log/spooler local7.* /var/log/boot.log
######### GLOBAL DIRECTIVES #### $template IpTemplate,"/var/log/mylog/%FROMHOST-IP%/%$YEAR%-%$MONTH%-%$DAY%.log" *.* ?IpTemplate & ~
syslog日志保存位置:
/var/log/mylog/%FROMHOST-IP%/%$YEAR%-%$MONTH%-%$DAY%.log
/var/log/mylog/192.168.187.237/2019-05-09.log
以上是关于syslog配置的主要内容,如果未能解决你的问题,请参考以下文章
syslog:在 ubuntu 上,如何配置 syslog 文件的旋转和 gzip'ing?
RK3588平台开发系列讲解(日志篇)RK3588 syslog的使用
RK3588平台开发系列讲解(日志篇)RK3588 syslog的使用