Skip to content

Fix external loggers respecting configured format#7699

Open
Rohithmatham12 wants to merge 1 commit into
cortexproject:masterfrom
Rohithmatham12:fix-json-log-format-external-loggers
Open

Fix external loggers respecting configured format#7699
Rohithmatham12 wants to merge 1 commit into
cortexproject:masterfrom
Rohithmatham12:fix-json-log-format-external-loggers

Conversation

@Rohithmatham12

@Rohithmatham12 Rohithmatham12 commented Jul 18, 2026

Copy link
Copy Markdown

What this changes

  • Routes gRPC package-level logs through the configured Cortex go-kit logger so transport errors respect server.log_format.
  • Replaces the side-effect automaxprocs import with explicit maxprocs.Set(...) after Cortex initializes logging, so maxprocs messages also use the configured format.
  • Preserves gRPC default severity behavior: errors only unless GRPC_GO_LOG_SEVERITY_LEVEL asks for warning/info.
  • Adds focused tests for gRPC and automaxprocs log output through the configured JSON logger.

Fixes #7697.

Testing

  • GOCACHE=/private/tmp/cortex-go-cache GOMODCACHE=/private/tmp/cortex-go-mod-cache go test ./pkg/util/log
  • GOCACHE=/private/tmp/cortex-go-cache GOMODCACHE=/private/tmp/cortex-go-mod-cache go test ./cmd/cortex

@dosubot dosubot Bot added go Pull requests that update Go code type/chore Something that needs to be done; not a bug or a feature labels Jul 18, 2026
Signed-off-by: Rohithmatham12 <rohithmatham@gmail.com>
@Rohithmatham12
Rohithmatham12 force-pushed the fix-json-log-format-external-loggers branch from e0e6dac to 9999625 Compare July 18, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go Pull requests that update Go code size/L type/chore Something that needs to be done; not a bug or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some logs ignore the JSON log format setting

1 participant