Described pbm logs command.
@@ -295,4 +295,56 @@ for the |pbm-delete-backup| command in the following format:
.. include:: .res/code-block/bash/pbm-delete-backup-older-than-timestamp.txt
+.. _pbm.logs:
+
+Viewing backup logs
+--------------------------------------------------------------------------------
+
+As of version 1.3.4, you can can see the logs from all ``pbm-agents`` in your MongoDB environment using ``PBM CLI``. This reduces time for finding required information when troubleshooting issues.
+
+To view |pbm-agent| logs, run the :program:`pbm logs` command and pass one or several flags to narrow down the search.
+
+The following flags are available:
+
+- ``-t``, ``--tail`` - Show the last N rows of the log
+- ``-e``, ``--event`` - Filter logs by all backups or a specific backup
+- ``-n``, ``--node`` - Filter logs by a specific node or a replica set
+- ``-s``, ``--severity`` - Filter logs by severity level. The following values are supported (from low to high):
+ - D - Debug
+ - I - Info
+ - W - Warning
+ - E - Error
+ - F - Fatal
+- ``-o``, ``--output`` - Show log information as text (default) or in JSON format.
+
+.. rubric:: Examples
+
+The following are some examples of filtering logs
+
+Show logs for all backups:
+
+.. code-block:: bash
+
+ $ pbm logs --event=backup
+
+Show the last 100 lines of the log about a specific backup 2020-10-15T17:42:54Z:
+
+.. code-block:: bash
+
+ $ pbm logs --tail=100 --event=backup/2020-10-15T17:42:54Z
+
+Include only errors from the specific replica set
+
+.. code-block:: bash
+
+ $ pbm logs -n rs1 -s E
+
+The output includes log messages of the specified severity type and all higher levels. Thus, when ERROR is specified, both ERROR and FATAL messages are shown in the output.
+
+.. rubric:: Implementation details
+
+``pbm-agents`` write log information into the ``pbmLog`` collection in the :term:`PBM Control collections`. Every |pbm-agent| also writes log information to stderr so that you can retrieve it when there is no living node in your cluster or replica set. For how to view an individual |pbm-agent| log, see :ref:`pbm-agent.log`.
+
+Note that log information from ``pbmLog`` collection is shown in the UTC timezone and fron the stderr - in the server's time zone.
+
.. include:: .res/replace.txt
