Todo #9712
Todo #8350: Remove clog in favor of standard syslogd or syslogd alternative with rotation via newsyslog or logrotate
Add code for packages to set their own log rotation parameters
100%
Description
Currently there is code for log rotation but there isn't a way for packages to influence how that rotation is handled without using their own custom newsyslog config file.
The existing code for logging uses a format in the package info.xml file like this:
<logging> <logsocket>/tmp/haproxy_chroot/var/run/log</logsocket> <facilityname>haproxy</facilityname> <logfilename>haproxy.log</logfilename> </logging>
That needs to be extended to support the rotation parameters mentioned in #9711
Associated revisions
Add a method for packages to set log owner on rotation. Issue #9712
History
#1
Updated by Jim Pingle over 1 year ago
For reference, the supported fields are now:
<logging> <facilityname>programname</facilityname> <logfilename>filename.log</logfilename> <logowner>root:wheel</logowner> <logmode>600</logmode> <rotatecount>7</rotatecount> <logfilesize>512000</logfilesize> <rotatetime>@T00</rotatetime> <rotateflags>p</rotateflags> <pidcmd>/var/run/program.pid</pidcmd> <signal>30</signal> </logging>
These tags go into the package info.xml file. See haproxy and tinc for examples.
#2
Updated by Jim Pingle over 1 year ago
- Status changed from New to Feedback
#3
Updated by Jim Pingle over 1 year ago
- % Done changed from 0 to 100
#4
Updated by Jim Pingle over 1 year ago
See also:
- Example of display-only log: https://github.com/pfsense/FreeBSD-ports/blob/devel/emulators/pfSense-pkg-Open-VM-Tools/files/usr/local/share/pfSense-pkg-Open-VM-Tools/info.xml
- Example of display-only log: https://github.com/pfsense/FreeBSD-ports/blob/devel/net-mgmt/pfSense-pkg-zabbix-agent/files/usr/local/share/pfSense-pkg-zabbix-agent/info.xml
- Example of display-only log: https://github.com/pfsense/FreeBSD-ports/blob/devel/net-mgmt/pfSense-pkg-zabbix-proxy/files/usr/local/share/pfSense-pkg-zabbix-proxy/info.xml
- Example of log with rotation configured: https://github.com/pfsense/FreeBSD-ports/blob/devel/sysutils/pfSense-pkg-apcupsd/files/usr/local/share/pfSense-pkg-apcupsd/info.xml
- Example with socket: https://github.com/pfsense/FreeBSD-ports/blob/devel/net/pfSense-pkg-haproxy/files/usr/local/share/pfSense-pkg-haproxy/info.xml
#5
Updated by Jim Pingle over 1 year ago
- Status changed from Feedback to Resolved
This appears to be operating as expected. Can address any new problems in separate issues.
Log rotation settings. Issue #9711 and Issue #9712
GUI