Skip to content

Conversation

@ivanauth
Copy link

Summary

  • Add --log-format flag to support JSON logging output
  • Enable structured logging for better integration with log aggregation systems

Description

This PR adds support for JSON-formatted logs in the SpiceDB Operator, addressing issue #349. By default, the operator uses text-based logging, but operators can now use the --log-format=json flag to enable structured JSON logging.

Changes

  • Added --log-format flag to the run command with validation
  • Integrated zap logger for JSON output when requested
  • Updated controller to accept logger as a parameter instead of creating hardcoded instances
  • Added comprehensive tests for the new functionality
  • Added example deployment manifest showing JSON logging configuration
  • Added documentation explaining the feature and integration with log aggregation systems

Testing

  • Added unit tests for log format validation
  • Added integration tests verifying JSON output format
  • Updated existing controller tests to pass logger parameter
  • All tests pass successfully

Backward Compatibility

  • Default behavior unchanged (text format)
  • No breaking changes to existing deployments
  • Empty log format defaults to text

Fixes #349

@ivanauth ivanauth force-pushed the fix/issue-349-json-logging branch from 20e2c42 to d605fb1 Compare December 13, 2025 02:19
@ivanauth ivanauth force-pushed the fix/issue-349-json-logging branch from d605fb1 to b40a844 Compare January 8, 2026 22:15
This fixes the lint errors:
- undefined: logger on lines 307, 314, 318
- unused import: k8s.io/klog/v2/textlogger
@ivanauth ivanauth force-pushed the fix/issue-349-json-logging branch from b40a844 to b43c193 Compare January 23, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Support JSON Logging

1 participant