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), or shipped to an OpenTelemetry (OTLP) endpoint. - 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[].otel
-
Supported on:
Ships log records to an OpenTelemetry-compatible (OTLP) endpoint over HTTP, Protobuf, or gRPC. Records are buffered by the OpenTelemetry SDK's
BatchLogRecordProcessorand flushed periodically or on shutdown.To forward all logs to an OTLP endpoint, add the appender to
logging.root.appenders:logging: appenders: otlp: type: otel protocol: proto url: https://collector:4318/v1/logs headers: Authorization: 'Bearer <token>' attributes: '[deployment.environment]': production root: appenders: [default, otlp]Datatype:
string - logging.appenders[].<appender-name>.type
-
Supported on:
The appender type determines where the log messages are sent. Required.
Datatype:
enumOptions:
-
console -
file -
otel -
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>.url
-
Supported on:
The OTLP endpoint URL to which log records are shipped. Required for the
otelappender type.The expected path depends on the chosen protocol:
- HTTP/Protobuf (
httporproto): typically ends in/v1/logs. For example,https://collector:4318/v1/logs. - gRPC (
grpc): a bare host and port without a path. For example,https://collector:4317.
Datatype:
string - HTTP/Protobuf (
- logging.appenders[].<appender-name>.protocol
-
Supported on:
The transport protocol used to send log records to the OTLP endpoint. Applies to the
otelappender type only.proto(default): OTLP over HTTP using Protobuf encoding. More compact thanhttp(JSON) and more broadly compatible thangrpc, which requires HTTP/2.http: OTLP over HTTP using JSON encoding.grpc: OTLP over gRPC. Headers must be provided as gRPC metadata key-value pairs.
Datatype:
enumDefault:
protoOptions:
-
proto -
http -
grpc
- logging.appenders[].<appender-name>.headers
-
Supported on:
Optional map of HTTP headers sent with every request to the OTLP endpoint. Applies to the
otelappender type only. Commonly used for authentication. For example,Authorization: 'Bearer <token>'orAuthorization: 'ApiKey <base64>'.For the
grpcprotocol the key-value pairs are sent as gRPC metadata instead of HTTP headers.WarningHeader values are stored in plain text in
kibana.yml. Use a secrets management solution or environment-variable substitution to avoid exposing credentials.Datatype:
object - logging.appenders[].<appender-name>.attributes
-
Supported on:
Optional map of additional OpenTelemetry resource attributes merged on top of the auto-detected host, process, OS, and service attributes. Applies to the
otelappender type only. Can be used to set or override attributes such asservice.nameordeployment.environment.Because Kibana expands dotted YAML keys into nested objects, wrap dotted attribute names in square brackets:
attributes: '[service.name]': my-kibana '[deployment.environment]': productionDatatype:
object - 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