Logging settings in Kibanaedit
You do not need to configure any additional settings to use the logging features in Kibana. Logging is enabled by default and will log at info
level using the pattern
layout, which outputs logs to stdout
.
However, if you are planning to ingest your logs using Elasticsearch or another tool, we recommend using the json
layout, which produces logs in ECS format. In general, pattern
layout is recommended when raw logs will be read by a human, and json
layout when logs will be read by a machine.
The logging configuration is validated against the predefined schema and if there are any issues with it, Kibana will fail to start with the detailed error message.
Kibana relies on three high-level entities to set the logging service: appenders, loggers, and root. These can be configured in the logging
namespace in kibana.yml
.
-
Appenders define where log messages are displayed (stdout or console) and their layout (
pattern
orjson
). They also allow you to specify if you want the logs stored and, if so, where (file on the disk). -
Loggers define what logging settings, such as the level of verbosity and the appenders, to apply to a particular context. Each log entry context provides information about the service or plugin that emits it and any of its sub-parts, for example,
metrics.ops
orelasticsearch.query
. - Root is a logger that applies to all the log entries in Kibana.
The following table serves as a quick reference for different logging configuration keys. Note that these are not stand-alone settings and may require additional logging configuration. See the Configure Logging in Kibana guide and complete examples for common configuration use cases.
|
Unique appender identifier. |
|
Appender to use for logging records to stdout. By default, uses the |
|
Allows you to specify a fileName to write log records to disk. To write all log records to file, add the file appender to |
|
Similar to Log4j’s |
|
The appender type determines where the log messages are sent. Options are |
|
Determines the filepath where the log messages are written to for file and rolling-file appender types. Required for appenders that write to file. |
|
Specify the triggering policy for when a rollover should occur for the |
|
Specify the time interval for rotating a log file for a |
|
Specify the size limit at which the policy should trigger a rollover for a |
|
Specify the time interval at which the policy should trigger a rollover for a time-interval type |
|
Whether the interval should be adjusted to cause the next rollover to occur on the interval boundary. Boolean. Default |
|
Rolling file strategy type. Only |
|
The suffix to append to the file path when rolling. Must include |
|
The maximum number of files to keep. Optional. Default is |
|
Determines how the log messages are displayed. Options are |
|
Optional boolean to highlight log messages in color. Applies to |
|
Optional string pattern for placeholders that will be replaced with data from the actual log message. Applicable to pattern type layout only. |
|
List of specific appenders to apply to |
|
Specify default verbosity for all log messages to fall back to if not specifically configured at the individual logger level. Options are |
|
Specific logger instance. |
|
Specify verbosity of log messages for <logger> context. Optional and inherits the verbosity of any ancestor logger, up to the |
|
Determines the appender to apply to a specific logger context as an array. Optional and falls back to the appender(s) of the |