From e834ad0093e8f2dc9cdcd73e011bd9f9d05d6a0b Mon Sep 17 00:00:00 2001 From: Ivana Huckova <30407135+ivanahuckova@users.noreply.github.com> Date: Wed, 11 Nov 2020 14:56:24 +0100 Subject: [PATCH] Docs: Add documentation about log levels (#28975) * Add documentation about log level * Update * Update * Update * Add unknow to table * Update docs/sources/explore/index.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> * Update docs/sources/panels/visualizations/logs-panel.md Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Co-authored-by: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> --- docs/sources/explore/index.md | 27 +++++++++++++++++++ .../panels/visualizations/logs-panel.md | 4 +++ 2 files changed, 31 insertions(+) diff --git a/docs/sources/explore/index.md b/docs/sources/explore/index.md index 1e3bb1ad4be..389be7dd3d5 100644 --- a/docs/sources/explore/index.md +++ b/docs/sources/explore/index.md @@ -155,6 +155,33 @@ Along with metrics, Explore allows you to investigate your logs with the followi Results of log queries are shown as histograms in the graph and individual logs are displayed below. If the data source does not send histogram data for the requested time range, the logs model computes a time series based on the log row counts bucketed by an automatically calculated time interval and the start of the histogram is then anchored by the first log row's timestamp from the result. The end of the time series is anchored to the time picker's **To** range. +#### Log level + +For logs where a **level** label is specified, we use the value of the label to determine the log level and update color accordingly. If the log doesn't have a level label specified, we parse the log to find out if its content matches any of the supported expressions (see below for more information). The log level is always determined by the first match. In case Grafana is not able to determine a log level, it will be visualized with **unknown** log level. + +**Supported log levels and mapping of log level abbreviation and expressions:** + + +| Supported expressions | Log level | Color | +| --------------------------- |:-------------:| -----------:| +| emerg | critical | purple | +| fatal | critical | purple | +| alert | critical | purple | +| crit | critical | purple | +| critical | critical | purple | +| err | error | red | +| eror | error | red | +| error | error | red | +| warn | warning | yellow | +| warning | warning | yellow | +| info | info | green | +| information | info | green | +| notice | info | green | +| dbug | debug | blue | +| debug | debug | blue | +| trace | trace | light blue | +| * | unknown | grey | + ### Visualization options You can customize how logs are displayed and select which columns are shown. diff --git a/docs/sources/panels/visualizations/logs-panel.md b/docs/sources/panels/visualizations/logs-panel.md index c101c863aac..84404e65b8b 100644 --- a/docs/sources/panels/visualizations/logs-panel.md +++ b/docs/sources/panels/visualizations/logs-panel.md @@ -17,6 +17,10 @@ The logs panel shows the result of queries that were entered in the Query tab. T To limit the number of lines rendered, you can use the **Max data points** setting in the **Query options**. If it is not set, then the data source will usually enforce a default limit. +## Log level + +For logs where a **level** label is specified, we use the value of the label to determine the log level and update color accordingly. If the log doesn't have a level label specified, we parse the log to find out if its content matches any of the supported expressions (see below for more information). The log level is always determined by the first match. In case Grafana is not able to determine a log level, it will be visualized with **unknown** log level. See [supported log levels and mappings of log level abbreviation and expressions](../explore/#log-level/). + ### Display options Use these settings to refine your visualization: