在我的配置中,我有 rsyslog 负责跟踪/home/user/my_app/shared/log/unicorn.stderr.log
使用imfile
. 使用 TCP 将内容发送到另一个远程日志服务器。
当日志文件轮换时,rsyslog 停止向远程服务器发送数据。
我尝试重新加载 rsyslog,发送 HUP 信号并完全重新启动它,但没有任何效果。
我发现实际有效的唯一方法是肮脏的:
kill -9
rsyslog 并重新开始。有没有合适的方法让我在不接触 rsyslog 内部的情况下做到这一点?
Rsyslog 文件
$ModLoad 标记 $ModLoad imudp $ModLoad imtcp $ModLoad imuxsock $ModLoad imklog $ModLoad 文件 $template withoutTimeFormat,"[环境] [%syslogtag%] -- %msg%" $WorkDirectory /var/spool/rsyslog $InputFileName /home/user/my_app/shared/log/unicorn.stderr.log $InputFileTag unicorn-stderr $InputFileStateFile stat-unicorn-stderr $InputFileSeverity 信息 $InputFileFacility local8 $InputFilePollInterval 1 $InputFilePersistStateInterval 1 $InputRunFileMonitor # 转发到远程服务器 如果 $syslogtag 包含 'apache-' 那么 @@my_server:5000;WithoutTimeFormat :syslogtag, …