Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Regression: --quiet disables --structured-logs again

Đang mở
#2,693 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@Firehed đang làm issue này rồi.

Từ ngày 7/10/2026.

  • #2694 của @Firehed — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
25/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
docker, go, google-cloud
Lĩnh vực
backend, observability

Hướng nghiên cứu

The issue points to the logger setup rework in #2106 and the earlier fix in #1750; start by comparing how --quiet and --structured-logs configure logging. Reproduce with the provided command and verify that errors, including multiline details, remain JSON with a severity field. A linked pull request (#2694) is already open.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Bug Description

When --structured-logs and --quiet are used together, error messages are written as plain text instead of JSON. This is the behavior reported in #1738 and fixed in v2.2.0 by #1750, so it is a regression.

Plain-text errors lose the severity field, and multi-line errors (for example, Google API errors with a Details: block) are split into separate entries by log collectors such as the GKE logging agent.

Bisecting the released images: v2.9.0 behaves correctly, and v2.10.0 through v2.26.0 (the latest as of this report) are affected. The change in behavior lines up with #2106, which reworked how the logger is set up.

Example code (or command)
cloud-sql-proxy --structured-logs --quiet --token=fake fake-proj:us-central1:fake-inst
Stacktrace
# v2.9.0 (expected)
{"severity":"ERROR","timestamp":"2026-10-07T23:07:14.054Z","message":"[fake-proj:us-central1:fake-inst] could not resolve instance version: ..."}

# v2.26.0 (actual)
2026/10/07 23:07:05 [fake-proj:us-central1:fake-inst] could not resolve instance version: failed to get instance: refresh error: ...
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
...
Steps to reproduce?
  1. docker run --rm gcr.io/cloud-sql-connectors/cloud-sql-proxy:2.26.0 --structured-logs --quiet --token=fake fake-proj:us-central1:fake-inst
  2. Errors on stderr are plain text.
  3. The same command with :2.9.0, or with --quiet removed, produces JSON errors.
Environment
  1. OS type and version: the official container images, run under Docker 29.4.0
  2. Cloud SQL Proxy version: 2.10.0 through 2.26.0
  3. Proxy invocation command: as above

This issue was written by AI (Claude Code).

Ngôn ngữ chính
Go
Star
1.4k
Fork
356
Merge trung bình
14 giờ 48 phút
Pull request đã merge (30 ngày)
8

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của GoogleCloudPlatform/cloud-sql-proxy

Tất cả issue của GoogleCloudPlatform/cloud-sql-proxy

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.