Syslog stops logging after log rotation

Each time newsyslog rotates the log file, syslog stops at the file. Until syslogd restart is complete.

(myserver:wheel)# logger -p local1.info -t myprocess "hello thiru"; ll myfile.log; cat myfile.log
-rw-r--r--  1 root  wheel     0B Nov 10 11:26 myfile.log

(myserver:wheel)# /etc/rc.d/syslogd restart
Stopping syslogd.
Starting syslogd.

(myserver:wheel)# logger -p local1.info -t myprocess "hello thiru"; ll myfile.log; cat myfile.log
-rw-r--r--  1 root  wheel    44B Nov 10 12:04 myfile.log
Nov 10 12:04:31 myserver myprocess: hello thiru 
(myserver:wheel)#

In Linux(which uses logrotate), we can solve this by running syslog/rsyslog restartthe postrotatelogroate conf section .

Is there something similar to postrotatein newsyslog?

Edit:

Syslog and newsyslog log files:

(TPC-E11-36:wheel)# cat /etc/newsyslog.d/newsyslog-myprocess.conf
/var/log/myfile.log 644 20 10000 * Z

(TPC-E11-36:wheel)# cat /etc/syslog.d/syslog-myprocess.conf
!myprocess
local1.info /var/log/myfile.log
(TPC-E11-36:wheel)#
+4
source share
1 answer

pidfile /etc/newsyslog.conf, , , 1, , 1, SIGHUP, newsyslog: https://www.freebsd.org/doc/handbook/configtuning-syslog.html

/:

# logfilename          [owner:group]    mode count size when  flags [/pid_file] [sig_num]

/var/log/your-app.log   root:wheel      600  7     *    @T00  GBJC  /var/run/your-app.pid 1

. : https://serverfault.com/a/701563/94862

+1

Source: https://habr.com/ru/post/1660425/


All Articles