linux - syslog stops logging after log rotation -


every time after newsyslog rotates log file, syslog stops logging file. until syslogd restart done.

(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)# 

on linux (which uses logrotate), can solve doing syslog/rsyslog restart in postrotate section of logroate conf.

is there similar postrotate in newsyslog?

edit:

syslog , newsyslog conf 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)# 

add path of pidfile /etc/newsyslog.conf , if required signal example 1 stands sighup, more info newsyslog here: https://www.freebsd.org/doc/handbook/configtuning-syslog.html

the format/example this:

# 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 

also see answer: https://serverfault.com/a/701563/94862


Comments

Popular posts from this blog

asynchronous - C# WinSCP .NET assembly: How to upload multiple files asynchronously -

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -