GrepBoard/Manuals
605 manuals ·

cephadm: no ceph.log in /var/log/ceph (mon_cluster_log_to_file)

·Tested on Ceph Reef 18.2 · Squid 19.2 official docs and source · 2026-10·Test scope ↓·7 steps

A cephadm Ceph cluster has no ceph.log by default. Turn on mon_cluster_log_to_file and log_to_file, avoid double logging, and roll the change back.

console
$ ls /var/log/ceph/

If that command comes back empty on a cephadm cluster, or ceph.log is missing, nothing is broken. cephadm starts every daemon with file logging switched off, and the monitor with mon_cluster_log_to_file switched off too. That option is what writes the cluster log (ceph.log). Turn both on and the files appear.

[1] Check where the logs go now. The Reef and Squid docs say cephadm daemons log to journald and the container runtime captures it. <fsid> is the output of ceph fsid.

console
$ ceph fsid$ journalctl -u ceph-<fsid>@mon.node1

The source shows the split. cephadm adds --default-log-to-file=false to each daemon command line. Unless log_to_journald was set explicitly, if the container engine is Podman 2.1.0 or newer (split cgroups supported) it adds --default-log-to-journald=true; otherwise --default-log-to-stderr=true. The monitor also gets --default-mon-cluster-log-to-file=false ([Squid 19.2.3 ceph.py L100-L133](https://github.com/ceph/ceph/blob/v19.2.3/src/cephadm/cephadmlib/daemons/ceph.py#L100-L133), [Reef 18.2.4 cephadm.py L3080-L3115](https://github.com/ceph/ceph/blob/v18.2.4/src/cephadm/cephadm.py#L3080-L3115)). In the option definitions, both log_to_file and mon_cluster_log_to_file default to true ([global.yaml.in L504-L511](https://github.com/ceph/ceph/blob/v19.2.3/src/common/options/global.yaml.in#L504-L511), [mon.yaml.in L136-L146](https://github.com/ceph/ceph/blob/v19.2.3/src/common/options/mon.yaml.in#L136-L146)). cephadm overrides those defaults on the command line.

[2] Decide whether you need files at all. These two commands show the cluster log without creating a file (docs: Monitoring).

console
$ ceph -w$ ceph log last 50

If a script or log shipper expects a ceph.log path, go on.

[3] Enable file logging. These are the commands from the official docs (cephadm Operations, Logging to files).

console
$ ceph config set global log_to_file true$ ceph config set global mon_cluster_log_to_file true

The option definition for mon_cluster_log_to_file carries the runtime flag, so no monitor restart is documented. log_to_file has no such flag in its definition, and when a daemon re-reads it was not checked. If no file appears, restart the daemon with ceph orch daemon restart <daemon-name>, which is in the docs (cephadm Operations). Do monitors one at a time and confirm the others keep quorum before moving on.

[4] Stop the same lines from also going to journald. The docs say to run these four commands when logging to files, because otherwise everything is logged twice.

console
$ ceph config set global log_to_stderr false$ ceph config set global mon_cluster_log_to_stderr false$ ceph config set global log_to_journald false$ ceph config set global mon_cluster_log_to_journald false

[5] Find the files. Inside the container /var/log/ceph is the host directory /var/log/ceph/<fsid>/ (cephadm mounts it that way: [ceph.py L395-L400](https://github.com/ceph/ceph/blob/v19.2.3/src/cephadm/cephadmlib/daemons/ceph.py#L395-L400)). The cluster log file name comes from the default of mon_cluster_log_file.

output
default=/var/log/ceph/$cluster.$channel.log cluster=/var/log/ceph/$cluster.log

That is the default value as written in [mon.yaml.in L148-L164](https://github.com/ceph/ceph/blob/v19.2.3/src/common/options/mon.yaml.in#L148-L164). The cluster channel goes to ceph.log and the audit channel to ceph.audit.log, so the host gets /var/log/ceph/<fsid>/ceph.log. The docs say the cluster log is written to disk on monitor servers, so only hosts running a monitor produce it (Monitoring docs L106-L108).

[6] Watch the disk. cephadm writes /etc/logrotate.d/ceph.<fsid> on each host. It rotates /var/log/ceph/<fsid>/*.log daily and keeps 7 compressed copies ([template cluster.logrotate.config.j2](https://github.com/ceph/ceph/blob/v19.2.3/src/cephadm/cephadmlib/templates/cluster.logrotate.config.j2#L1-L13)). To change retention, edit that file, as the docs say. Volume depends on the debug_* levels; no per-day size figure was found in the sources.

[7] Roll back. Removing the entries from the central config returns each option to the default cephadm passes on the command line (files off). ceph config rm is defined in MonCommands.h (L1385).

console
$ ceph config rm global log_to_file$ ceph config rm global mon_cluster_log_to_file$ ceph config rm global log_to_stderr$ ceph config rm global mon_cluster_log_to_stderr$ ceph config rm global log_to_journald$ ceph config rm global mon_cluster_log_to_journald$ ceph config show mon.<mon-name> mon_cluster_log_to_file

The last command shows the value the running monitor actually uses and where it came from (config docs). After the entries are removed it should read false, with default as the source (cephadm's --default-… arguments are stored as CONF_DEFAULT: [config.cc L778-L784](https://github.com/ceph/ceph/blob/v19.2.3/src/common/config.cc#L778-L784)). If a value is still in the central config, the source shows mon. Per the docs, ceph config get shows only compiled-in defaults (true), so it cannot confirm the rollback (same doc L530-L533). If the value does not change right away, use the restart above the same way.

For a new cluster, cephadm bootstrap --log-to-file sets these six options in the initial config ([cephadm.py L2501-L2507](https://github.com/ceph/ceph/blob/v19.2.3/src/cephadm/cephadm.py#L2501-L2507)).

#ceph#cephadm#logging#mon_cluster_log_to_file