To specify a configuration file to change the logging behavior, add this line to
the /etc/nova/nova.conf
file . To change the logging level,
such as DEBUG
, INFO
,
WARNING
, ERROR
), use:
log-config=/etc/nova/logging.conf
The logging configuration file is an ini-style configuration file, which must
contain a section called logger_nova
, which controls the behavior
of the logging facility in the nova-*
services. For
example:
[logger_nova] level = INFO handlers = stderr qualname = nova
This example sets the debugging level to INFO
(which less
verbose than the default DEBUG
setting).
For more details on the logging configuration syntax, including the meaning of the
handlers
andquaname
variables, see the Python documentation on logging configuration file format f.For an example
logging.conf
file with various defined handlers, see the OpenStack Configuration Reference.
You can configure OpenStack Compute services to send logging information to
syslog
. This is useful if you want to use
rsyslog
, which forwards the logs to a remote machine.
You need to separately configure the Compute service (nova), the Identity service
(keystone), the Image Service (glance), and, if you are using it, the Block Storage
service (cinder) to send log messages to syslog
. To do so,
add the following lines to:
/etc/nova/nova.conf
/etc/keystone/keystone.conf
/etc/glance/glance-api.conf
/etc/glance/glance-registry.conf
/etc/cinder/cinder.conf
verbose = False debug = False use_syslog = True syslog_log_facility = LOG_LOCAL0
In addition to enabling syslog
, these settings also
turn off more verbose output and debugging output from the log.
Note | |
---|---|
Although the example above uses the same local facility for each service
( |
rsyslog
is a useful tool for setting up a centralized
log server across multiple machines. We briefly describe the configuration to set up
an rsyslog
server; a full treatment of
rsyslog
is beyond the scope of this document. We assume
rsyslog
has already been installed on your hosts
(default for most Linux distributions).
This example provides a minimal configuration for
/etc/rsyslog.conf
on the log server host, which receives
the log files:
# provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 1024
Add a filter rule to /etc/rsyslog.conf
which looks for a
host name. The example below uses compute-01
as an
example of a compute host name:
:hostname, isequal, "compute-01
" /mnt/rsyslog/logs/compute-01.log
On each compute host, create a file named
/etc/rsyslog.d/60-nova.conf
, with the following
content:
# prevent debug from dnsmasq with the daemon.none parameter *.*;auth,authpriv.none,daemon.none,local0.none -/var/log/syslog # Specify a log level of ERROR local0.error @@172.20.1.43:1024
Once you have created this file, restart your rsyslog
daemon. Error-level log messages on the compute hosts should now be sent to your log
server.