terrarum

home rss

Puppet, OpenStack, and rsyslog

05 Dec 2012

Introduction

Sébastien Han posted a good article on how to use rsyslog with OpenStack. Coincidentally, I recently configured rsyslog for an OpenStack project and figured I'd publish my configuration, too.

Configuring rsyslog

I have three puppet manifests that I use to configure rsyslog:

base.pp is simply declared in both client.pp and server.pp.

Configuring the Server

server.pp is used to configure a server to be an rsyslog-server. To apply it, simply do:

class { 'admin::rsyslog::server': }

Although that seems simple enough, the heavy work is in the two files that the manifest uses:

Configuring the Client

Client configuration is just a simple as server configuration:

class { 'admin::rsyslog::client':
  server => 'rsyslog.example.com',
}

OpenStack and syslog

As Sébastien described, each OpenStack component can be configured to send their logs to syslog. You can see this being done in the following manifests (search for "syslog"):

For Swift, the proxy-logging middleware sends the logs to syslog.

Sorting and Organizing

When an OpenStack component sends a log to the rsyslog server, the log is passed through the filters in the server.conf file. Based on if the log is from Swift (special case), the log facility, and the hostname, the log is directed to a specific log file in a specific directory.

I have logs going into the following directories:

Conclusion

rsyslog provides a great deal of flexibility when it comes to logging. Puppet, as usual, comes to the rescue in making the complexities of such services manageable.

While this solution works for me, I have plans to revisit OpenStack logs in combination with logstash in the future.

Comments

comments powered by Disqus