Logging settings
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 (
patternorjson). 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.opsorelasticsearch.query. - Root is a logger that applies to all the log entries in Kibana.
For details on audit logging settings, refer to the Kibana security settings.
Logging settings
The following list 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.
- logging.appenders[].<appender-name>
-
Supported on:
Unique appender identifier.
Datatype:
string - logging.appenders[].console
-
Supported on:
Appender to use for logging records to stdout. By default, uses the
[%date][%level][%logger] %message %errorpattern layout. To use a json, set the layout type tojson.%erroris present since Stack version 9.1.Datatype:
string - logging.appenders[].file
-
Supported on:
Allows you to specify a fileName to write log records to disk. To write all log records to file, add the file appender to
root.appenders. If configured, you also need to specifylogging.appenders.file.pathName.Datatype:
string - logging.appenders[].rolling-file
-
Supported on:
Similar to Log4j's
RollingFileAppender, this appender will log to a file and rotate if following a rolling strategy when the configured policy triggers. There are currently two policies supported:size-limitandtime-interval.Datatype:
string - logging.appenders[].<appender-name>.type
-
Supported on:
The appender type determines where the log messages are sent. Required.
Datatype:
enumOptions:
-
console -
file -
rewrite -
rolling-file
-
- logging.appenders[].<appender-name>.fileName
-
Supported on:
Determines the filepath where the log messages are written to for file and rolling-file appender types. Required for appenders that write to file.
Datatype:
string - logging.appenders[].<appender-name>.policy.type
-
Supported on:
Specify the triggering policy for when a rollover should occur for the
rolling-filetype appender.Datatype:
string - logging.appenders[].<appender-name>.policy.interval
-
Supported on:
Specify the time interval for rotating a log file for a
time-intervaltyperolling-fileappender.Datatype:
stringDefault:
24h - logging.appenders[].<appender-name>.policy.size
-
Supported on:
Specify the size limit at which the policy should trigger a rollover for a
size-limittyperolling-fileappender.Datatype:
stringDefault:
100mb - logging.appenders[].<appender-name>.policy.modulate
-
Supported on:
Whether the interval should be adjusted to cause the next rollover to occur on the interval boundary.
Datatype:
boolDefault:
true - logging.appenders[].<appender-name>.strategy.type
-
Supported on:
Rolling file strategy type. Only
numericis currently supported.Datatype:
string - logging.appenders[].<appender-name>.strategy.pattern
-
Supported on:
The suffix to append to the file path when rolling. Must include
%i.Datatype:
string - logging.appenders[].<appender-name>.strategy.max
-
Supported on:
The maximum number of files to keep. The maximum is
100.Datatype:
intDefault:
7 - logging.appenders[].<appender-name>.layout.type
-
Supported on:
Determines how the log messages are displayed. Required.
Datatype:
enumOptions:
-
pattern- Provides human-readable output. -
json- Provides ECS-compliant output.
-
- logging.appenders[].<appender-name>.layout.highlight
-
Supported on:
Optional boolean to highlight log messages in color. Applies to
patternlayout only.Datatype:
boolDefault:
false - logging.appenders[].<appender-name>.layout.pattern
-
Supported on:
Optional string pattern for placeholders that will be replaced with data from the actual log message. Applicable to pattern type layout only.
Datatype:
string - logging.root.appenders[]
-
Supported on:
List of specific appenders to apply to
root. Defaults toconsolewithpatternlayout.Datatype:
string - logging.root.level
-
Supported on:
Specify default verbosity for all log messages to fall back to if not specifically configured at the individual logger level. The
allandofflevels can be used only in configuration and are just handy shortcuts that allow you to log every log record or disable logging entirely or for a specific logger.Datatype:
enumDefault:
infoOptions:
-
all -
fatal -
error -
warn -
info -
debug -
trace -
off
-
- logging.loggers[].<logger>.name
-
Supported on:
Specific logger instance.
Datatype:
string - logging.loggers[].<logger>.level
-
Supported on:
Specify verbosity of log messages for a logger context. Optional and inherits the verbosity of any ancestor logger, up to the
rootloggerlevel.Datatype:
enumOptions:
-
all -
fatal -
error -
warn -
info -
debug -
trace -
off
-
- logging.loggers[].<logger>.appenders
-
Supported on:
Determines the appender to apply to a specific logger context as an array. Optional and falls back to the appender(s) of the
rootlogger if not specified.Datatype:
string - deprecation.enable_http_debug_logs
-
Supported on:
Optional boolean to log debug messages when a deprecated API is called.
Datatype:
boolDefault:
false