Skip to content

fix(logs): avoid false-positive error level for no-error values (#4538)#4539

Open
brendler wants to merge 1 commit into
Dokploy:canaryfrom
brendler:fix/4538-log-type-false-positive
Open

fix(logs): avoid false-positive error level for no-error values (#4538)#4539
brendler wants to merge 1 commit into
Dokploy:canaryfrom
brendler:fix/4538-log-type-false-positive

Conversation

@brendler
Copy link
Copy Markdown

@brendler brendler commented Jun 2, 2026

What

getLogType classifies log lines purely by keyword/substring matching, with no awareness of the value following a keyword. As a result, successful job-scheduler completion lines such as:

▶ NOTICE Finished job "nightly-task" in "1.2s", failed: false, skipped: false, error: none

get highlighted red as errors, because error: none matches the error: pattern and failed: false matches the failed pattern.

Closes #4538.

Changes

  • error: / err:, failed, and failure now only classify as an error when not immediately followed by a no-error value (none|null|false|nil|no|0), via negative lookahead. This is value-specific, not a blanket suppressor — a line like error: none, failed: true is still correctly flagged as an error.
  • Bare NOTICE (no colon) is now treated as info so scheduler lines short-circuit before the error branch. notice: (with colon) is left to the warning branch, preserving existing behaviour.

Tests

Added __test__/utils/log-type.test.ts covering the scheduler "finished" line, error: none, the mixed error: none, failed: true case (proves the exclusion isn't over-broad), genuine errors, and bare NOTICE. All pass.

Note

This is a targeted fix for the reported false positives. The underlying heuristic is still substring-based and has produced similar issues before (see closed #3305); a structured log-level parser would be the more robust long-term solution, but is out of scope here.

@brendler brendler requested a review from Siumauricio as a code owner June 2, 2026 13:44
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. bug Something isn't working labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log viewer classifies successful lines as "error" (red) False positives in log level detection (getLogType)

1 participant