# Craft CMS log viewer: ERROR/WARNING/INFO/DEBUG counters always show 0 on Craft 5

**Project:** Bugs | **Board:** Planned | **Votes:** 1
**URL:** https://roadmap.ploi.io/projects/7-bugs/items/1579-craft-cms-log-viewer-errorwarninginfodebug-counters-always-show-0-on-craft-5

---

## Issue: Craft CMS Log Level Filters Showing Zero Counts

### Problem

In **Server → Site → Craft CMS → Logs**, the level filter counters all show **(0)** even when the log file clearly contains entries.

For example, when viewing `console-2026-08-16.log`, the raw content pane displays many lines such as:

```text
2026-08-17 01:10:01 [console.WARNING] [craft\services\Plugins::init] Invalid plugin base path: ...
```

However, the filter buttons above the log still show:

```text
ERROR (0)
WARNING (0)
INFO (0)
DEBUG (0)
```

As a result, the filters cannot be used to narrow down the log entries.

### Likely Cause

This appears to be a log format mismatch.

Craft moved its logging to **Monolog in Craft 4.4**, and `Craft\log\MonologTarget` writes log lines in the following format:

```text
%datetime% [%channel%.%level_name%] [%extra.yii_category%] %message% %context% %extra%
```

This means the log level now appears with a channel prefix, for example:

```text
[console.WARNING]
[web.ERROR]
[queue.CRITICAL]
```

rather than the older Craft 3 format:

```text
[warning]
[error]
```

If the parser is still matching the older format, it would find no matching log levels. This would explain why every counter shows `(0)` even though entries are visible in the raw log.

### Suggested Fix

Update the level matching to allow for an optional channel prefix. This should support both the current Monolog format and older Craft 3 log formats.

### Environment

* **Craft CMS:** 5.10.14
* **PHP:** 8.3
* **Log location:** `storage/logs/{web,queue,console}-Y-m-d.log`

### Note

The raw log display itself works correctly. The issue only affects the **level counters and filter buttons**.

