Re: Remove newsyslog messages from logs

From: Polytropon <freebsd_at_edvax.de>
Date: Sat, 25 Mar 2023 18:57:52 UTC
On Sat, 25 Mar 2023 18:07:11 +0000, Carlos Lopez wrote:
> Maybe it is a stupid question, [...]

Not at all.



> [...] but would it be possible to
> delete/avoid "newsyslog[1137]: logfile turned over due to
> size>..." messages generated by newsyslog every time it
> rotates a log file?

Yes, this is supported. Just have newsyslog pretend the log
file in question is a binary log file, so the insertion of
the message will be suppressed. Set the `B' flag (field #7)
in /etc/newsyslog.conf, for example:

/var/log/messages            644  5     100  *     JCB
                                                     ^

Files that typically have this flag are /var/log/pflog,
/var/log/sendmail.st, or /var/log/wtmp, as they are binary
files. But it should work with text files, too.

See "man 5 newsyslog.conf" for details.


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...