Skip to content

Commit

Permalink
Merge pull request #307 from canonical/doc-log-level
Browse files Browse the repository at this point in the history
Document the log manipulation facilities.
  • Loading branch information
lmlg committed Feb 23, 2024
2 parents 0f58a71 + 8788358 commit bfd9424
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/how-to/change-log-level.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
======================
Changing the log level
======================

By default, the MicroCeph daemon runs with the log level set to DEBUG. While that is the desirable
behaviour for a good number of use cases, there are instances when this level is far too high -
for example, embedded devices where storage is much more limited. For these reasons, the MicroCeph
daemon exposes a way to both get and set the log level.

Configuring the log level
-------------------------

MicroCeph includes the command ``log``, with the sub-commands ``set-level`` and ``get-level``. When setting, we support both string and integer formats for the log level. For example:

.. code-block:: none
sudo microceph log set-level warning
sudo microceph log set-level 3
Both commands are equivalent. The mapping from integer to string can be consulted by querying the
help for the ``set-level`` sub-command. Note that any changes made to the log level take effect
immediately, and need no restarts.

On the other hand, the ``get-level`` sub-command takes no arguments and returns an integer level only.
Any value returned by ``get-level`` can be used for ``set-level``.

For example, after setting the level as shown in the example, we can verify in this way:

.. code-block:: none
sudo microceph log get-level
3

0 comments on commit bfd9424

Please sign in to comment.