
Logging
=======

.. program:: jetstream server

JetStream server logs to standard out, but installations on some operating systems rely on system facilities for better integration (see below). To stop logging to standard out or customize the log file location, you can use the :option:`--log` command line parameter.

.. seealso::
  * :ref:`configuration#editing_configuration`


Rocky Linux 9.2, Ubuntu 22.04
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Systemd will handle logging for the processes. Each JetStream service is configured to log into syslog under its service name as the identifier (e.g. ``jetstream-server``). There are a number of ways to look at the logs:

  * The last few lines are usually shown with the systemctl status command: :command:`systemctl status -l jetstream-server`
  * :command:`journalctl` can be used to view more of the log, if systemd is setup to use journal logging: :command:`journalctl -u jetstream-server`
  * The previous command can be used in combination with the :samp:`-n{X}` flag to show the last ``X`` lines (eg. ``-n20``) and the ``-f`` flag can be used to tail the log (just like :command:`tail -f`)
  * Alternatively, the system log can be :command:`tail`'d (or :command:`grep`'d) for JetStream messages. For example: :command:`tail -n 40 -f /var/log/messages | grep jetstream` (assuming default system configuration where syslog writes to :file:`/var/log/messages`)


macOS
~~~~~

JetStream server will log under :file:`/var/log/jetstream-server.log`.
