Setting up BIRD logs

In this article, I will give examples of setting up logs in BIRD.

Let’s create a log file (it is worth considering that with incorrect rights to the log file, bird will not start):

mkdir /var/log/bird/
touch /var/log/bird/bird.log
chown -R bird:bird /var/log/bird/

I will give examples of logging levels (the commented out first and second examples are the same, and debug is disabled in the third):

#log "/var/log/bird/bird.log" all;
#log "/var/log/bird/bird.log" { debug, trace, info, remote, warning, error, auth, fatal, bug };
log "/var/log/bird/bird.log" { trace, info, remote, warning, error, auth, fatal, bug };
#log stderr all;
#log syslog all;

Specify the time format (iso long is ISO 8601 date/time format (YYYY-MM-DD hh:mm:ss)):

timeformat base     iso long;
timeformat log      iso long;
timeformat protocol iso long;
timeformat route    iso long;

You can specify iso long ms with millisecond precision or iso long us with microsecond precision.
And also without a date – iso short (hh:mm:ss), similarly, you can specify iso short ms and iso short us.

You can write logs to different files, for example:

log "/var/log/bird/debug.log" { debug };
log "/var/log/bird/info.log" { info };
log "/var/log/bird/auth.log" { auth };

Setting debug levels:

debug protocols { routes, interfaces };
#debug protocols all|off|{ states, routes, filters, interfaces, events, packets }
#debug channels all|off|{ states|routes|filters|events }
#debug commands 0|1|2

See also my articles:
Bird log rotation
Quagga. Setting up logging

Leave a comment

Leave a Reply