]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: fix logging defaults 32641/head
authorSage Weil <sage@redhat.com>
Tue, 14 Jan 2020 23:11:48 +0000 (17:11 -0600)
committerSage Weil <sage@redhat.com>
Fri, 17 Jan 2020 14:11:55 +0000 (08:11 -0600)
- prefix stderr log lines with 'debug '
- send cluster log to stderr (only affects mons)
- default to sending cluser log to stderr only (not to file)

This aligns things with the container-y way, as we do
with rook.  It means that if you want legacy behavior (log files),
you have *2* settings to change:

 log_to_file = true
 mon_cluster_log_to_file = true

We could default this to leave cluster log to file by default
since they aren't that big (and we do have log rotation), but
it's not as clean as it could be...

Signed-off-by: Sage Weil <sage@redhat.com>
src/cephadm/cephadm

index 985e70a38631cdb887e11402ce875b58efa5dc45..90f15903cbf6bf72e9f1a803364a7fbc3d18a0d6 100755 (executable)
@@ -748,12 +748,17 @@ def get_daemon_args(fsid, daemon_type, daemon_id):
 
     if daemon_type in Ceph.daemons:
         r += [
+            '--setuser', 'ceph',
+            '--setgroup', 'ceph',
             '--default-log-to-file=false',
             '--default-log-to-stderr=true',
-            '--setuser', 'ceph',
-            '--setgroup', 'ceph'
+            '--default-log-stderr-prefix=debug\ ',
         ]
-
+        if daemon_type == 'mon':
+            r += [
+                '--default-mon-cluster-log-to-file=false',
+                '--default-mon-cluster-log-to-stderr=true',
+            ]
     elif daemon_type in Monitoring.components:
         component = Monitoring.components[daemon_type]  # type: ignore
         metadata = component.get('image', list())  # type: ignore