Hide log level in Grafana ≥12.3.0 Explore / Drilldown view

After updating to Grafana 12.3.0 I’m now stuck with these here in Explore/Drilltown View:

In previous versions they were already there, but it was a subtle color bar:

There does not seem to be any option to hide/disable this.

And moreover.. it doesn’t make any sense - I guess Grafana tries to find the strings “debug”, “info”, … somewhere in the log line, but the “new look” is just ugly for multi-line logs:

I would say that’s not Grafana, but Loki. Just try to disable that in your Loki:

# Discover and add log levels during ingestion, if not present already. Levels
# would be added to Structured Metadata with name
# level/LEVEL/Level/Severity/severity/SEVERITY/lvl/LVL/Lvl (case-sensitive) and
# one of the values from 'trace', 'debug', 'info', 'warn', 'error', 'critical',
# 'fatal' (case insensitive).
# CLI flag: -validation.discover-log-levels
[discover_log_levels: <boolean> | default = true]
1 Like

The setting is off, but even if there should be an option on the visualization side to not display it.

@simon18 at the moment, the only way to not display log levels in Explore is that all your logs have a ‘unknown’ as the log level, which is not rendered by the panel.

Additionally, for multi-line logs, make sure line wrapping is disabled in your options:

If none of this works for you, you can disable the new panel and use the legacy one by setting the newLogsPanel feature flag as disabled.

tbh, I like the new panel in terms of having clickable options to build the log line (previously this was only possible by altering the Loki query like line_format {{.timestamp}} {{.message}} …)..

..but why did you move from subtle coloured bars to textual labels that can’t be hidden in any way. I wish there was an option to turn these off altogether (also the coloured bars.. they were not quite disturbing when browsing through multi-line logs, but this should be customisable).

The problem was exactly that. Levels, instead of being explicit, were being displayed as both subtle and ambiguous colors, so you would have to add level as a displayed field to know the actual level, or open log details and look for the level field.

There’s a follow-up item added to this issue to consider an option to enable or disable the display of level.

So far, this is the first time we hear about showing level being disruptive.

I’m still curious about your issue with multi-line logs, because with our without level, it shouldn’t affect how those logs are displayed. Have you tried changing line wrapping as suggested?

tbh, I would rather manually add a field than having a magic extracting this for me :face_with_raised_eyebrow:
I mean right now browsing through ‘legacy formatted logs’* that span over multiple lines looks like this:

And the extracting magic seems to just take the first occurrence of some buzzword in the final log line, completely ignoring fields that would mark it otherwise:


*Logs that were not pre-processed by tools like promtail, vector or something

When level is not provided, there is code in core Grafana to infer the level from the log line, but that is not new. That has been around for many years already.

The only way to not have that code be triggered is to configure Loki to send the right level in the right field, or configure it to always be “unknown” and have the logs visualization don’t show it.