From 2aa82ffdbc289adf743b378f36f7ccfa6e907fc3 Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Tue, 25 Mar 2014 18:44:23 +0000 Subject: [PATCH] [hopem] Added use-syslog cfg option to allow logging to syslog --- config.yaml | 5 +++++ hooks/hooks.py | 3 ++- revision | 2 +- templates/ceph.conf | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/config.yaml b/config.yaml index dfeae00b..43176274 100644 --- a/config.yaml +++ b/config.yaml @@ -78,3 +78,8 @@ options: description: | Key ID to import to the apt keyring to support use with arbitary source configuration from outside of Launchpad archives or PPA's. + use-syslog: + type: boolean + default: False + description: | + If set to True, supporting services will log to syslog. diff --git a/hooks/hooks.py b/hooks/hooks.py index 7b536b8d..1340b993 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -71,7 +71,8 @@ def emit_cephconf(): 'mon_hosts': ' '.join(mon_hosts), 'fsid': get_fsid(), 'version': ceph.get_ceph_version(), - 'osd_journal_size': config('osd-journal-size') + 'osd_journal_size': config('osd-journal-size'), + 'use_syslog': str(config('use-syslog')).lower() } # Install ceph.conf as an alternative to support # co-existence with other charms that write this file diff --git a/revision b/revision index 8351c193..3f10ffe7 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -14 +15 \ No newline at end of file diff --git a/templates/ceph.conf b/templates/ceph.conf index 107beece..cd81d440 100644 --- a/templates/ceph.conf +++ b/templates/ceph.conf @@ -9,6 +9,9 @@ keyring = /etc/ceph/$cluster.$name.keyring mon host = {{ mon_hosts }} fsid = {{ fsid }} + log to syslog = {{ use_syslog }} + err to syslog = {{ use_syslog }} + clog to syslog = {{ use_syslog }} [mon] keyring = /var/lib/ceph/mon/$cluster-$id/keyring