]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add cli option to enable logging to syslog
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 22 Aug 2023 19:11:35 +0000 (15:11 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 19 Sep 2023 20:17:24 +0000 (16:17 -0400)
Add the --log-dest option to cephadm. The --log-dest option can be
specified 0, 1 or more times. If unspecified, cephadm will log to
the default location, the log file. If specified one ore more times,
each instance will enable the named logging destination.
Example:

```
cephadm boostrap

cephadm --log-dest=syslog bootstrap

cephadm --log-dest=file bootstrap

cephadm --log-dest=syslog --log-dest=file bootstrap
```

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index fb40a9d67f537c881064f2ee10f5a2a3dd3acb2b..5d14ea773eca61e80bc0dc5be4f5bdfcac626396 100755 (executable)
@@ -137,7 +137,7 @@ from cephadmlib.net_utils import (
 from cephadmlib.locking import FileLock
 from cephadmlib.daemon_identity import DaemonIdentity, DaemonSubIdentity
 from cephadmlib.packagers import create_packager, Packager
-from cephadmlib.logging import cephadm_init_logging, Highlight
+from cephadmlib.logging import cephadm_init_logging, Highlight, LogDestination
 
 FuncT = TypeVar('FuncT', bound=Callable)
 
@@ -8813,6 +8813,11 @@ def _get_parser():
         '--verbose', '-v',
         action='store_true',
         help='Show debug-level log messages')
+    parser.add_argument(
+        '--log-dest',
+        action='append',
+        choices=[v.name for v in LogDestination],
+        help='select one or more destination for persistent logging')
     parser.add_argument(
         '--timeout',
         type=int,