diff --git a/config.yaml b/config.yaml index 8a9e76eb..6294eb65 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,8 @@ options: + loglevel: + default: 1 + type: int + description: RadosGW debug level. Max is 20. source: type: string default: diff --git a/hooks/ceph_radosgw_context.py b/hooks/ceph_radosgw_context.py index 1e079904..5cdd82a0 100644 --- a/hooks/ceph_radosgw_context.py +++ b/hooks/ceph_radosgw_context.py @@ -99,6 +99,7 @@ class MonContext(context.OSContextGenerator): 'old_auth': cmp_pkgrevno('radosgw', "0.51") < 0, 'use_syslog': str(config('use-syslog')).lower(), 'embedded_webserver': config('use-embedded-webserver'), + 'loglevel': config('loglevel'), } if self.context_complete(ctxt): diff --git a/templates/ceph.conf b/templates/ceph.conf index e1c95fce..e62e1e25 100644 --- a/templates/ceph.conf +++ b/templates/ceph.conf @@ -10,6 +10,7 @@ mon host = {{ mon_hosts }} log to syslog = {{ use_syslog }} err to syslog = {{ use_syslog }} clog to syslog = {{ use_syslog }} +debug rgw = {{ loglevel }}/5 [client.radosgw.gateway] host = {{ hostname }} diff --git a/unit_tests/test_ceph_radosgw_context.py b/unit_tests/test_ceph_radosgw_context.py index 4394f683..7a58d4e9 100644 --- a/unit_tests/test_ceph_radosgw_context.py +++ b/unit_tests/test_ceph_radosgw_context.py @@ -165,7 +165,8 @@ class MonContextTest(CharmTestCase): 'hostname': '10.0.0.10', 'mon_hosts': '10.5.4.1:6789 10.5.4.2:6789 10.5.4.3:6789', 'old_auth': False, - 'use_syslog': 'false' + 'use_syslog': 'false', + 'loglevel': 1, } self.assertEqual(expect, mon_ctxt()) @@ -197,7 +198,8 @@ class MonContextTest(CharmTestCase): 'hostname': '10.0.0.10', 'mon_hosts': '10.5.4.1:6789 10.5.4.2:6789 10.5.4.3:6789', 'old_auth': False, - 'use_syslog': 'false' + 'use_syslog': 'false', + 'loglevel': 1, } self.assertEqual(expect, mon_ctxt()) @@ -221,6 +223,7 @@ class MonContextTest(CharmTestCase): 'hostname': '10.0.0.10', 'mon_hosts': '10.5.4.1:6789 10.5.4.2:6789 10.5.4.3:6789', 'old_auth': False, - 'use_syslog': 'false' + 'use_syslog': 'false', + 'loglevel': 1, } self.assertEqual(expect, mon_ctxt())