Skip to content

⭐️ fix logging severity for GKE/cloud log explorers#1372

Merged
chris-rock merged 2 commits intomainfrom
fix/gke-logging-severity
Feb 6, 2026
Merged

⭐️ fix logging severity for GKE/cloud log explorers#1372
chris-rock merged 2 commits intomainfrom
fix/gke-logging-severity

Conversation

@chris-rock
Copy link
Copy Markdown
Member

Summary

  • Configure logger to output structured JSON with GCP-compatible severity levels
  • Use severity field instead of level for log level (GCP requirement)
  • Map WARN to WARNING and DPANIC/PANIC/FATAL to CRITICAL
  • Also compatible with AKS (Azure) and EKS (AWS) log aggregation

Problem

Both INFO and ERROR messages were incorrectly recognized as errors in Google Log Explorer, making it hard to filter logs by severity.

Before:

2026-02-05T16:18:23+01:00    INFO    test message    {"key": "value"}

After:

{"severity":"INFO","ts":"2026-02-05T16:19:23+01:00","msg":"test message","key":"value"}

Test plan

  • Unit tests for GCP level encoder added
  • Deploy to GKE and verify logs appear with correct severity in Log Explorer
  • Verify logs work correctly in AKS/EKS environments

Fixes #916

🤖 Generated with Claude Code

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 5, 2026

Test Results

  5 files  ±0   41 suites  ±0   36m 5s ⏱️ +26s
301 tests +9  301 ✅ +9  0 💤 ±0  0 ❌ ±0 
320 runs  +9  318 ✅ +9  2 💤 ±0  0 ❌ ±0 

Results for commit eda7bc4. ± Comparison against base commit 64f2d59.

♻️ This comment has been updated with latest results.

chris-rock and others added 2 commits February 6, 2026 13:42
Configure the logger to output structured JSON with GCP-compatible
severity levels. This fixes issue #916 where both INFO and ERROR
messages were incorrectly recognized as errors in Google Log Explorer.

Changes:
- Use JSON encoding by default (Development: false) for proper cloud log parsing
- Use "severity" field instead of "level" for log level (GCP requirement)
- Map WARN to WARNING (GCP expects WARNING, not WARN)
- Map DPANIC/PANIC/FATAL to CRITICAL
- Add tests for the GCP level encoder

This change is also compatible with AKS and EKS log aggregation.

Fixes #916

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update comments to reference all major cloud providers (GKE, AKS, EKS)
instead of just GCP/GKE.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@chris-rock chris-rock force-pushed the fix/gke-logging-severity branch from 5bd2743 to eda7bc4 Compare February 6, 2026 12:51
@chris-rock chris-rock merged commit feff81f into main Feb 6, 2026
24 checks passed
@chris-rock chris-rock deleted the fix/gke-logging-severity branch February 6, 2026 13:03
@github-actions github-actions Bot locked and limited conversation to collaborators Feb 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix logging in GKE

1 participant