envoyproxy/gateway

logs: timestamp format regressed to Unix epoch float since v1.8.0

已关闭

#9,492 创建于 2026年7月14日

 (1 条评论) (0 个反应) (0 位负责人)Go (802 个派生)auto 404
help wanted

仓库指标

星标
 (2,871 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Description: Since v1.8.0, Envoy Gateway logs emit timestamps as Unix epoch floats (e.g. 1.7840510610168722e+09) instead of human-readable ISO 8601 strings (e.g. 2026-07-14T17:44:06.617Z). This makes logs difficult to read and breaks tooling that expects a standard timestamp format.

The regression was introduced by pr https://github.com/envoyproxy/gateway/pull/8555 ("feat: JSON log encoder uses abbreviated field keys"), which changed initZapLogger in internal/logging/log.go from zap.NewDevelopmentEncoderConfig() to zap.NewProductionEncoderConfig(). The production config uses zapcore.EpochTimeEncoder instead of zapcore.ISO8601TimeEncoder.

Expected behavior: timestamps are formatted as ISO 8601, matching the behavior of v1.7.x and earlier.

Repro steps: Run the envoy-gateway server via Docker and observe the log output:

# v1.7.x — correct
docker run --rm envoyproxy/gateway:v1.7.5 server 2>&1 | head -2

# v1.8.x — broken
docker run --rm envoyproxy/gateway:v1.8.2 server 2>&1 | head -2

Environment:

  • Envoy Gateway v1.8.0, v1.8.2 (affected)
  • Envoy Gateway v1.7.5 and earlier (not affected)

Logs: v1.7.5 (expected):

2026-07-14T17:44:41.384Z     INFO    cmd/server.go:139       No config file provided, using default parameters
2026-07-14T17:44:41.384Z     INFO    config-loader   loader/configloader.go:120      running hook

v1.8.2 (actual):

1.7840510610168722e+09       info    cmd/server.go:139       No config file provided, using default parameters
1.7840510610169678e+09       info    config-loader   loader/configloader.go:120      running hook

Suggested fix in internal/logging/log.go:

cfg := zap.NewProductionEncoderConfig()
cfg.EncodeTime = zapcore.ISO8601TimeEncoder

贡献者指南