lfd on example.com SYSLOG Check Failed - Problem with logging.

Operating System & Version
AlmaLinux v8.7.0
cPanel & WHM Version
108.0.12

peterk

Active Member
Mar 22, 2019
29
4
3
Poland
cPanel Access Level
Root Administrator
Hello,

For the past few days I have been receiving emails with the following message:

Time: Sat Feb 25 20:17:35 2023 +0100
Error: Failed to detect code [Uzu5u0Wiuq8DgDhIZ0MP7H9xUNYs] in SYSLOG_LOG [var/log/messages]

SYSLOG may not be running correctly on server.example.com


The issue is strange because I have not done anything with the server recently.
I also noticed that the logger also does not save information in var/log/messages

When I perform the test nothing is saved in the log.

[root@gamma log]# logger -p auth.notice "test-log"
[root@gamma log]# grep "test-log" var/log/messages
[root@gamma log]#


I have tried several ways from the forum to solve the problem but nothing works.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
16,505
2,605
363
cPanel Access Level
Root Administrator

peterk

Active Member
Mar 22, 2019
29
4
3
Poland
cPanel Access Level
Root Administrator
Hello,

I tried this solution but unfortunately it does not work.
It looks like rsyslog is working but not saving any information.

The system is a new installation from two weeks ago, I did not make any changes to etc/rsyslog.conf or etc/systemd/journald.conf
All settings are default.
 

peterk

Active Member
Mar 22, 2019
29
4
3
Poland
cPanel Access Level
Root Administrator
Hello,

I found the solution to my problem - maybe it will be useful to someone.
The problem was caused by the journal system, its files were corrupted, below is how I fixed it.

I verified the files by:
journalctl --verify

This is where the errors occurred.

Next rotate files:
journalctl --rotate

Then I delete the old entries:
journalctl --vacuum-time=1s

I then delete all files from the directory:
var/log/journal

Then delete the file:
var/lib/rsyslog/imjournal.state

(This file stores the rsyslog state for journal file reading)
The files will be restored after restarting the services.

Now you just need to restart the services:

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


And everything is back to normal.