OPNsense Forum

Archive => 22.1 Legacy Series => Topic started by: Ben. on January 30, 2022, 12:26:18 PM

Title: Clearing local logs doesn't re-create "latest.log" symlink
Post by: Ben. on January 30, 2022, 12:26:18 PM
Hi,

With 22.1 we have now this handy symbolic link "latest.log" pointing to the latest logfile.

I just realized though that this symlink is getting removed (and not re-created) when you reset your local log files.

Do others also face this issue or am I just too impatient that it would be re-created once there is the next log entry written?
Title: Re: Clearing local logs doesn't re-create "latest.log" symlink
Post by: franco on January 30, 2022, 01:07:15 PM
We can change that but what do you use it for? It's not used anywhere in the system except for opnsense-log utility which can only be used manually.


Cheers,
Franco
Title: Re: Clearing local logs doesn't re-create "latest.log" symlink
Post by: Ben. on January 30, 2022, 01:11:49 PM
Im not sure I understand your question.

Since 22.1 there is the link /var/log/system/latest.log which was introduced to make log processing easier, no?
I use this symlink to monitor the system log via monit.

Now if I reset the logs to clear some disk space, this link is removed and monit sends me alerts that the file doesnt exist.
So if the function "clear logfiles" would just recreate the symbolic link, there is no alert in monit.

Does this answer your question?
Title: Re: Clearing local logs doesn't re-create "latest.log" symlink
Post by: franco on January 30, 2022, 01:13:39 PM
> I use this symlink to monitor the system log via monit.

Ok, you would be the first :)

GitHub issue in core would be helpful. The symlink is recreated every hour via cron job. The log clear was missed it seems.

This is all good and well... progress.


Cheers,
Franco
Title: Re: Clearing local logs doesn't re-create "latest.log" symlink
Post by: franco on January 30, 2022, 01:14:41 PM
PS: Reboot or the following command works as well if you can't wait for the cron job...

# configctl syslog archive
Title: Re: Clearing local logs doesn't re-create "latest.log" symlink
Post by: Ben. on January 30, 2022, 01:52:27 PM
Thanks, good to know.

Maybe I will not remain the first ;)