Skip to content

Commit

Permalink
More logging syntax updates
Browse files Browse the repository at this point in the history
  • Loading branch information
TinaHeiligers committed Feb 19, 2021
1 parent 25af5ed commit b66d739
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/core/server/logging/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ tags: ['kibana','dev', 'contributor', 'api docs']
# Logging
- <DocLink id="kibCoreLogging" section="loggers-appenders-layouts" text="Loggers, Appenders and Layouts"/>
- <DocLink id="kibCoreLogging" section="logger-heirarchy" text="Logger hierarchy"/>
- <DocLink id="kibCoreLoggin" section="log-level" text="Log level"/>
- <docLink id="kibCoreLogging" section="layouts" text="Layouts"/>
- <docLink id="kibCoreLogging" section="pattern-layout" text="Pattern layout"/>
- <docLink id="kibCoreLogging" section="json-layout" text="JSON layout"/>
- <docLink id="kibCoreLogging" section="appenders" text="Appenders"/>
- <docLink id="kibCoreLogging" section="rolling-file-appender" text="Rolling File Appender"/>
- <docLink id="kibCoreLogging" section="triggering-policies" text="Triggering Policies"/>"
- <docLink id="kibCoreLogging" section="rolling-strategies" text="Rolling strategies"/>
- <docLink id="kibCoreLogging" section="configuration" text="Configuration"/>
- <docLink id="kibCoreLogging" section="usage" text="Usage"/>
- <docLink id="kibCoreLogging" section="logging-config-migration" text="Logging config migration"/>
- <docLink id="kibCoreLogging" section="log-record-format-changes" text="Log record format changes"/>
- <DocLink id="kibCoreLogging" section="log-level" text="Log level"/>
- <DocLink id="kibCoreLogging" section="layouts" text="Layouts"/>
- <DocLink id="kibCoreLogging" section="pattern-layout" text="Pattern layout"/>
- <DocLink id="kibCoreLogging" section="json-layout" text="JSON layout"/>
- <DocLink id="kibCoreLogging" section="appenders" text="Appenders"/>
- <DocLink id="kibCoreLogging" section="rolling-file-appender" text="Rolling File Appender"/>
- <DocLink id="kibCoreLogging" section="triggering-policies" text="Triggering Policies"/>
- <DocLink id="kibCoreLogging" section="rolling-strategies" text="Rolling strategies"/>
- <DocLink id="kibCoreLogging" section="configuration" text="Configuration"/>
- <DocLink id="kibCoreLogging" section="usage" text="Usage"/>
- <DocLink id="kibCoreLogging" section="logging-config-migration" text="Logging config migration"/>
- <DocLink id="kibCoreLogging" section="log-record-format-changes" text="Log record format changes"/>

The way logging works in Kibana is inspired by `log4j 2` logging framework used by [Elasticsearch](https://www.elastic.co/guide/en/elasticsearch/reference/current/settings.html#logging).
The main idea is to have consistent logging behaviour (configuration, log format etc.) across the entire Elastic Stack
Expand Down Expand Up @@ -52,15 +52,19 @@ fully configured.
Developer can configure _log level_ and _appenders_ that should be used within particular context name. If logger configuration
specifies only _log level_ then _appenders_ configuration will be inherited from the ancestor logger.

__Note:__ in the current implementation log messages are only forwarded to appenders configured for a particular logger
<DocCallOut color="warning" title="Appender additivity is not supported">
In the current implementation log messages are only forwarded to appenders configured for a particular logger
context name or to appenders of the closest ancestor if current logger doesn't have any appenders configured. That means that
we __don't support__ so called _appender additivity_ when log messages are forwarded to _every_ distinct appender within
ancestor chain including `root`.
</DocCallOut>

## Log level

Currently we support the following log levels: _all_, _fatal_, _error_, _warn_, _info_, _debug_, _trace_, _off_.

Levels are ordered, so _all_ > _fatal_ > _error_ > _warn_ > _info_ > _debug_ > _trace_ > _off_.

A log record is being logged by the logger if its level is higher than or equal to the level of its logger. Otherwise,
the log record is ignored.

Expand All @@ -71,7 +75,7 @@ log record or disable logging entirely for the specific context name.

Every appender should know exactly how to format log messages before they are written to the console or file on the disk.
This behaviour is controlled by the layouts and configured through `appender.layout` configuration property for every
custom appender (see examples in [Configuration](#configuration)). Currently we don't define any default layout for the
custom appender (see examples in <DocLink id="kibCoreLogging" section="configuration" text="Configuration"/>). Currently we don't define any default layout for the
custom appenders, so one should always make the choice explicitly.

There are two types of layout supported at the moment: `pattern` and `json`.
Expand Down

0 comments on commit b66d739

Please sign in to comment.