Ubuntu18.04系统rsyslog不记录日志问题

使用rsyslogd -f /etc/rsyslog.conf -N 1检查配置,无报错。

尝试重启服务,未解决:

systemctl restart syslog.socket
systemctl restart systemd-journald.socket
systemctl restart rsyslog

修改rsyslog.conf配置,添加如下配置,重启rsyslog服务,开启debug日志:

$DebugFile /var/log/debug
$DebugLevel 2

比对发下,记录异常的服务器,debug文件中记录的启动日志,缺失如下部分:

4868.692809878:main thread    : wti.c: sent SIGTTIN to worker thread 0x7f21720f8700
4868.692816994:main thread    : wtp.c: main Q:Reg: waiting 1500ms on worker thread termination, 1 still running
4868.692921354:main Q:Reg/w0  : wti 0x5626ef493060: wti.c: worker awoke from idle processing
4868.692931698:main Q:Reg/w0  : queue.c: DeleteProcessedBatch: we deleted 0 objects and enqueued 0 objects
4868.692936460:main Q:Reg/w0  : queue.c: doDeleteBatch: delete batch from store, new sizes: log 0, phys 0
4868.692941371:main Q:Reg/w0  : queue.c: regular consumer finished, iret=4, szlog 0 sz phys 0
4868.692945473:main Q:Reg/w0  : wti 0x5626ef493060: wti.c: terminating worker terminateRet=5, bInactivityTOOccured=0
4868.692950304:main Q:Reg/w0  : wti.c: DDDD: wti 0x5626ef493060: worker cleanup action instances
4868.692954432:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 0, ptr (nil)
4868.692958462:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 1, ptr 0x7f215c0088d0
4868.692963690:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 2, ptr 0x7f215c002480
4868.692969072:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 3, ptr (nil)
4868.692972996:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 4, ptr (nil)
4868.692976893:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 5, ptr (nil)
4868.692980639:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 6, ptr (nil)
4868.692984584:main Q:Reg/w0  : wti.c: wti 0x5626ef493060, action 7, ptr 0x7f215c002660
4868.692998207:main Q:Reg/w0  : wti.c: wti 0x5626ef493060: worker exiting
4868.693003018:main Q:Reg/w0  : wtp.c: main Q:Reg: Worker thread 5626ef493060, terminated, num workers now 0
4868.693030339:main Q:Reg/w0  : debug.c: destructor for debug call stack 0x7f215c000b20 called

搜索发下,该进程由如下配置控制:

/etc/systemd/journald.conf中的配置ForwardToSyslog,修改为yes即可。

另外,出现异常时,可根据异常发生的时间,修改异常发生时间前当天修改过的配置文件,问题很大概率由此配置导致。

参考链接:

Rsyslog Debug Support — rsyslog 8.18.0.master documentation

(1条消息) rsyslog无法发送日志到server端问题定位_chenwr2018的博客-CSDN博客

rsyslog不记录 (qastack.cn)

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值