MyNixOS website logo
option

services.matrix-synapse.log

Default configuration for the loggers used by matrix-synapse and its workers. The defaults are added with the default priority which means that these will be merged with additional declarations. These additional declarations also take precedence over the defaults when declared with at least normal priority. For instance the log-level for synapse and its workers can be changed like this:

{ lib, ... }: {
  services.matrix-synapse.log.root.level = "WARNING";
}

And another field can be added like this:

{
  services.matrix-synapse.log = {
    loggers."synapse.http.matrixfederationclient".level = "DEBUG";
  };
}

Additionally, the field handlers.journal.SYSLOG_IDENTIFIER will be added to each log config, i.e.

  • synapse for matrix-synapse.service
  • synapse-<worker name> for matrix-synapse-worker-<worker name>.service

This is only done if this option has a handlers.journal field declared.

To discard all settings declared by this option for each worker and synapse, lib.mkForce can be used.

To discard all settings declared by this option for a single worker or synapse only, or can be used.

Declarations
Type
attribute set of (YAML value)
Default
{
  disable_existing_loggers = false;
  formatters = {
    journal_fmt = {
      format = "%(name)s: [%(request)s] %(message)s";
    };
  };
  handlers = {
    journal = {
      class = "systemd.journal.JournalHandler";
      formatter = "journal_fmt";
    };
  };
  root = {
    handlers = [
      "journal"
    ];
    level = "INFO";
  };
  version = 1;
}