Atom feed of this document
 

 Managing logs

 Logging module

Adding the following line to /etc/nova/nova.conf will allow you to specify a configuration file for changing the logging behavior, in particular for changing the logging level (e.g., DEBUG, INFO, WARNING, ERROR):

log-config=/etc/nova/logging.conf

The log config file is an ini-style config file which must contain a section called logger_nova, which controls the behavior of the logging facility in the nova-* services. The file must contain a section called logger_nova, 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). See the Python documentation on logging configuration file format for more details on this file, including the meaning of the handlers and quaname variables. See etc/nova/logging_sample.conf in the openstack/nova repository on GitHub for an example logging.conf file with various handlers defined.

 Syslog

OpenStack Compute services can be configured to send logging information to syslog. This is particularly useful if you want to use rsyslog, which will forward 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]Note

While the example above uses the same local facility for each service (LOG_LOCAL0, which corresponds to syslog facility LOCAL0), we recommend that you configure a separate local facility for each service, as this provides better isolation and more flexibility. For example, you may want to capture logging info at different severity levels for different services. Syslog allows you to define up to seven local facilities, LOCAL0, LOCAL1, ..., LOCAL7. See the syslog documentation for more details.

 Rsyslog

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, which is the default on most Linux distributions.

This example shows a minimal configuration for /etc/rsyslog.conf on the log server host which will receive the log files:

# provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 1024

Add to /etc/rsyslog.conf a filter rule on which looks for a hostname. The example below use compute-01 as an example of a compute host name:

:hostname, isequal, "compute-01" /mnt/rsyslog/logs/compute-01.log

On the compute hosts, 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.

Log a bug against this page


loading table of contents...