Configure logging by going to System Console > Environment > Logging, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Output logs to console

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to output logs to the console.

  • true: (Default) Output log messages are written to the console based on the console log level configuration. The server writes messages to the standard output stream (stdout).

  • false: Output log messages aren’t written to the console.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.EnableConsole": true",

  • Environment variable: MM_LOGSETTINGS_ENABLECONSOLE

Console log level

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

The level of detail in log events written when Mattermost outputs log messages to the console.

  • DEBUG: (Default) Outputs verbose detail for developers debugging issues.

  • ERROR: Outputs only error messages.

  • INFO: Outputs error messages and information around startup and initialization.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.ConsoleLevel": DEBUG",

  • Environment variable: MM_LOGSETTINGS_CONSOLELEVEL

Output console logs as JSON

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to output console logs as JSON.

  • true: (Default) Logged events are written in a machine-readable JSON format. Typically set to true in production.

  • false: Logged events are written in plain text.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.ConsoleJson": true",

  • Environment variable: MM_LOGSETTINGS_CONSOLEJSON

Output logs to file

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to output console logs to a file.

  • true: (Default) Logged events are written based on the file log level configuration to a mattermost.log file located in the directory configured via file location. Typically set to true in production.

  • false: Logged events aren’t written to a file.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.EnableFile": true",

  • Environment variable: MM_LOGSETTINGS_ENABLEFILE

File log level

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

The level of detail in log events when Mattermost outputs log messages to a file.

  • DEBUG: Outputs verbose detail for developers debugging issues.

  • ERROR: Outputs only error messages.

  • INFO: (Default) Outputs error messages and information around startup and initialization.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.FileLevel": INFO",

  • Environment variable: MM_LOGSETTINGS_FILELEVEL

Output file logs as JSON

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to output file logs as JSON.

  • true: (Default) Logged events are written in a machine-readable JSON format. Typically set to true in production.

  • false: Logged events are written in plain text.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.FileJson": true",

  • Environment variable: MM_LOGSETTINGS_FILEJSON

File log directory

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

The location of the log files.

String input. If left blank, log files are stored in the ./logs directory.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.FileLocation": "",

  • Environment variable: MM_LOGSETTINGS_FILELOCATION

Note: The path you configure must exist, and Mattermost must have write permissions for this directory.

Enable webhook debugging

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to capture the contents of incoming webhooks to log files for debugging.

  • true: (Default) The contents of incoming webhooks are printed to log files for debugging.

  • false: The contents of incoming webhooks aren’t printed to log files.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.EnableWebhookDebugging": true",

  • Environment variable: MM_LOGSETTINGS_ENABLEWEBHOOKDEBUGGING

Enable diagnostics and error reporting

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to allow any combination of console, local file, syslog, and TCP socket targets, and send log records to multiple targets.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.AdvancedLoggingConfig": "",

  • Environment variable: MM_LOGSETTINGS_ADVANCEDLOGGINGCONFIG

Output logs to multiple targets

plans-img Available on all plans

deployment-img self-hosted deployments

Available in legacy Enterprise Edition E10/E20

Configure Mattermost to allow any combination of console, local file, syslog, and TCP socket targets, and send log records to multiple targets.

String input can contain a filespec to another configuration file, a database DSN, or JSON.

  • System Config path: Environment > Logging

  • config.json setting: ".LogSettings.AdvancedLoggingConfig": "",

  • Environment variable: MM_LOGSETTINGS_ADVANCEDLOGGINGCONFIG

Notes:

  • These targets have been chosen as they support the vast majority of log aggregators, and other log analysis tools, without needing additional software installed.

  • Logs are recorded asynchronously to reduce latency to the caller.

  • Advanced logging supports hot-reloading of logger configuration.

See the audit log v2 documentation for additional information.