<<<macOS WeeWX Guides>>>

Managing the Log File

You will probably find that the log file starts to fill up at an alarming rate, to solve this we need to add some entries to the log rotation program:

First you need to create a new file in the /etc/newsyslog.d area as shown below.

$ sudo vi /etc/newsyslog.d/weewx.conf

# logfilename          [owner:group]    mode count size when  flags [/pid_file] [sig_num]
/Library/Logs/weewx.log                 644  5     *    $D0
/Library/Logs/weewx_error.log           644  5     *    $W0  
    

The values used are as follows

The new file is automatically loaded every time you run newsyslog and can be checked with the same command as shown below

$ sudo newsyslog

$ sudo newsyslog -vv
/Library/Logs/named.log 5J: --> will trim at Tue Dec 30 00:00:00 2014
/Library/Logs/weewx.log 6: --> will trim at Tue Dec 30 00:00:00 2014
/Library/Logs/weewx_error.log 6: --> will trim at Sun Jan  4 00:00:00 2015