OpsGuide-Logging-RSysLog

= rsyslog =

A number of operating systems use rsyslog as the default logging service. Since it is natively able to send logs to a remote location, you do not have to install anything extra to enable this feature, just modify the configuration file. In doing this, consider running your logging over a management network or using an encrypted VPN to avoid interception.

rsyslog client configuration
To begin, configure all OpenStack components to log to the syslog log file in addition to their standard log file location. Also, configure each component to log to a different syslog facility. This makes it easier to split the logs into individual components on the central server:



and :





By default, Object Storage logs to syslog.

Next, create  with the following line:

*.* @192.168.1.10 This instructs rsyslog to send all logs to the IP listed. In this example, the IP points to the cloud controller.

rsyslog server configuration
Designate a server as the central logging server. The best practice is to choose a server that is solely dedicated to this purpose. Create a file called  with the following contents:

# Enable UDP $ModLoad imudp $UDPServerAddress 192.168.1.10 $UDPServerRun 514
 * 1) Listen on 192.168.1.10 only
 * 1) Port 514

$template NovaFile,&quot;/var/log/rsyslog/%HOSTNAME%/nova.log&quot; $template NovaAll,&quot;/var/log/rsyslog/nova.log&quot;
 * 1) Create logging templates for nova

$template DynFile,&quot;/var/log/rsyslog/%HOSTNAME%/syslog.log&quot;
 * 1) Log everything else to syslog.log
 * .* ?DynFile

local0.* ?NovaFile local0.* ?NovaAll &amp; ~ This example configuration handles the nova service only. It first configures rsyslog to act as a server that runs on port 514. Next, it creates a series of logging templates. Logging templates control where received logs are stored. Using the last example, a nova log from c01.example.com goes to the following locations:
 * 1) Log various openstack components to their own individual file



This is useful, as logs from c02.example.com go to:



This configuration will result in a separate log file for each compute node as well as an aggregated log file that contains nova logs from all nodes.