``profile::log_client``
=======================

This module manages the local logging-related configuration.

It can make the journal permanent, enable or disable legacy configuration files
(e.g. ``/var/log/messages``), and configure log forwarding.


Parameters
----------

============================  ========  ==================================================
**Name**                      **Type**  **Default**
----------------------------  --------  --------------------------------------------------
forward_to                    list      hiera('log_client::forward_to', [])
legacy_logs                   bool      hiera('log_client::legacy_logs')
persistent_journal            bool      hiera('log_client::persistent_journal')
journal_system_keep_free      string    hiera('log_client::journal_system_keep_free')
journal_system_max_file_size  string    hiera('log_client::journal_system_max_file_size')
journal_system_max_use        string    hiera('log_client::journal_system_max_use')
============================  ========  ==================================================


``journal_system_keep_free``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How much space `systemd-journald(8) <https://www.freedesktop.org/software/systemd/man/systemd-journald.html>`_ should keep free for non-journal
use in ``/var/log``. In addition to the syntax described in
`journald.conf(5) <https://www.freedesktop.org/software/systemd/man/journald.conf.html#SystemMaxUse=>`_ (bytes or use K, M, G, T, P, E as units) we also support percentages, ie ``'25%'`` means that
the journal will leave at least 25% of ``/var/log`` for other uses.
Note that for the use of a percentage limit ``/var/log`` must be an separate partition, else absolute values need to be set.


``journal_system_max_file_size``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The maximum size of individual journal files.


``journal_system_max_use``
~~~~~~~~~~~~~~~~~~~~~~~~~~

The maximum amount of space that the journal is allowed to use. In addition to
the syntax described in `journald.conf(5) <https://www.freedesktop.org/software/systemd/man/journald.conf.html#SystemMaxUse=>`_ (bytes or use K, M, G, T, P, E as units) we also support percentages,
ie ``'50%'`` means that the journal can use at most 50% of ``/var/log``.
Note that for the use of a percentage limit ``/var/log`` must be an separate partition, else absolute values need to be set.


``forward_to``
~~~~~~~~~~~~~~

An array of FQDNs, possibly prefixed with ``@`` for enabling TCP and followed by
a port number. Log messages are forwarded to all entries in this list.


``legacy_logs``
~~~~~~~~~~~~~~~

A boolean controlling whether the legacy log files (``/var/log/messages`` etc)
should be created (true) or not (false).


``persistent_journal``
~~~~~~~~~~~~~~~~~~~~~~

A boolean controlling whether the journal should be persistent (true) or not
(false).


Examples
--------

This profile is included in the base role. To customize the log_client in a
role, do this::

  class role::some_role () {
    class {'role::base':
      include_log_client => false,
      ...
    }

    class {'profile::log_client':
      legacy_logs        => false,
      persistent_journal => true,
    }

In Hiera, configure forwarding to ``log1`` using UDP on port 1514 and to
``log2`` using TCP (on port 514)::

  log_client::forward_to:
    - 'log1.psi.ch:1514'
    - '@log2.psi.ch'
