Bind 9 Administrator Reference Manual
Chapter 6. BIND 9 Configuration Reference
6.2.10. logging Statement Definition and Usage
The logging statement configures a wide variety of logging options for the nameserver. Its channel
phrase associates output methods, format options and severity levels with a name that can then be used
with the category phrase to select how various classes of messages are logged.
Only one logging statement is used to define as many channels and categories as are wanted. If there is
no logging statement, the logging configuration will be:
logging {
category "unmatched" { "null"; };
category "default" { "default_syslog"; "default_debug"; };
};
In BIND 9, the logging configuration is only established when the entire configuration file has been
parsed. In BIND 8, it was established as soon as the logging statement was parsed. When the server is
starting up, all logging messages regarding syntax errors in the configuration file go to the default
channels, or to standard error if the "-g" option was specified.
6.2.10.1. The channel Phrase
All log output goes to one or more channels; you can make as many of them as you want.
Every channel definition must include a destination clause that says whether messages selected for the
channel go to a file, to a particular syslog facility, to the standard error stream, or are discarded. It can
optionally also limit the message severity level that will be accepted by the channel (the default is info),
and whether to include a named-generated time stamp, the category name and/or severity level (the
default is not to include any).
The null destination clause causes all messages sent to the channel to be discarded; in that case, other
options for the channel are meaningless.
The file destination clause directs the channel to a disk file. It can include limitations both on how large
the file is allowed to become, and how many versions of the file will be saved each time the file is opened.
If you use the versions log file option, then named will retain that many backup versions of the file by
renaming them when opening. For example, if you choose to keep 3 old versions of the file lamers.log
then just before it is opened lamers.log.1 is renamed to lamers.log.2, lamers.log.0 is renamed
to lamers.log.1, and lamers.log is renamed to lamers.log.0. You can say versions unlimited;
to not limit the number of versions. If a size option is associated with the log file, then renaming is only
done when the file being opened exceeds the indicated size. No backup versions are kept by default; any
existing log file is simply appended.
The size option for files is used to limit log growth. If the file ever exceeds the size, then named will stop
writing to the file unless it has a versions option associated with it. If backup versions are kept, the files
52