I will give an example of setting up Quagga logging.
For example, once setting up quagga on the next Ubuntu Server 18, I noticed a lot of entries in the logs:
ZEBRA: Try to set TE Link Param
The server had accel-ppp installed, which often created and removed ipoe interfaces, in the configuration file /etc/quagga/zebra.conf I specified the path to the logs like this:
log file /var/log/zebra.log
In Ubuntu Server 16.04, such messages did not clog the logs, so I decided to specify another logging level by changing the line to:
log file /var/log/zebra.log errors
After that, such informational messages were no longer displayed in the logs. If you do not specify the log level, the default will be “debugging”. If the path to the file is not specified at all and the daemon terminates with an error, then it will try to save the logs here /var/tmp/quagga…crashlog (the existing file is not overwritten, it must be deleted manually).
Logging levels can be as follows:
emergencies, alerts, critical, errors, warnings, notifications, informational, debugging
You can quickly clear a large log file like this:
echo "" > /var/log/zebra.log
To apply the changes to the /etc/quagga/zebra.conf file, I restarted Zebra:
sudo service zebra restart
sudo service zebra status
sudo service bgpd status
Similarly, you can specify the path to the log file and the message level for bgpd and other daemons in their configuration files or console, for example:
log file /var/log/quagga/bgpd.log informational
You can add or remove the display of the severity level in messages:
log record-priority
no log record-priority
You can change the display of time in messages to microseconds:
log timestamp precision <0-6>
no log timestamp precision
Writing the entered commands to logs, including passwords (to disable, you must also restart the daemon):
log commands
Logging to syslog:
log syslog level
no log syslog
Configuring the display of logs in stdout and monitor:
log stdout
log stdout level
no log stdout
log monitor
log monitor level
no log monitor
See also my articles:
Installing Quagga on Ubuntu Server 18
Setting up BGP in Quagga
Setting up BIRD logs