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>
This commit is contained in:
Ivana Huckova 2020-11-11 14:56:24 +01:00 committed by GitHub
parent 6d40206431
commit e834ad0093
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 0 deletions

View File

@ -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. 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 ### Visualization options
You can customize how logs are displayed and select which columns are shown. You can customize how logs are displayed and select which columns are shown.

View File

@ -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. 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 ### Display options
Use these settings to refine your visualization: Use these settings to refine your visualization: