.. _osdx_events: ==================== Enabling OSDx Events ==================== OSDx provides two forms of logging: the system journal and syslog. Enable Logs =========== By default, in OSDx, the lower log levels are hidden to avoid having too much noise in the log. To enable the lower log levels, you can use the following command: In the OSDx CLI, enter as configuration mode ``configure`` and then: Enable global log level: ------------------------ **Example:** .. code-block:: none admin@osdx# set system cli configuration logging global debug admin@osdx# * :osdx:cfg:`system cli configuration logging global *` Enable log level for a specific module: --------------------------------------- If you just want to enable the log level for a specific module, you can use these commands: **Example:** .. code-block:: none admin@osdx# set service snmp log-level debug admin@osdx# There are several modules where you can enable the log level. Here are some examples: * :osdx:cfg:`service snmp log-level *` * :osdx:cfg:`service ssh log-level *` * :osdx:cfg:`service ssm log-level *` * :osdx:cfg:`service cfm log-level *` * :osdx:cfg:`service cnm log-level *` * :osdx:cfg:`service dhcp-client log-level debug` * :osdx:cfg:`service dns proxy log level *` * :osdx:cfg:`service firewall * logging level *` * :osdx:cfg:`service nsm log-level *` To monitor the logs, we highly recommend using two terminals: one to execute the commands and another to monitor the generated logs. The :osdx:op:`system journal monitor` command will show the logs in real time. For more information about the logs and on how to use the journal, you can refer to the following link: :ref:`management/monitoring/logging/index:Logging` Enable Syslog ============= OSDx supports the syslog message logging standard, which allows it to send events to remote syslog servers as well as to store logs continuously on the system. For example, set the following commands if all you want is to permanentlty store ``ssh`` logs on the system: **Example:** .. code-block:: none admin@osdx# set system syslog file sshd_msg filter myfilter app sshd admin@osdx# set system syslog file sshd_msg filter myfilter level debug admin@osdx# commit admin@osdx$ file show running://log/user/sshd_msg/sshd_msg 2024-05-06 09:59:38.920598 auth-info , sshd[5757]: Received disconnect from 192.168.212.139 port 51556:11: disconnected by user 2024-05-06 09:59:38.920978 auth-info , sshd[5757]: Disconnected from user admin 192.168.212.139 port 51556 2024-05-06 09:59:38.949362 authpriv-info , sshd[5753]: pam_unix(sshd:session): session closed for user admin ``sshd_msg`` is the filename where the message was written, while ``myfilter`` is the filter set applied to the message. In this example, the filter is configured to debug level solely for the ``sshd`` subsystem. Here, syslog messages are stored in the ``runnning://log/user/`` directory by default. For more information about syslog and filters, check out the :doc:`/articles/system/syslog/index` chapter.