Skip to content

blog: Send syslog messages at severity matching their level#8849

Open
beautifulentropy wants to merge 1 commit into
reland-slogfrom
slog-audit/10-blog-syslog-severity
Open

blog: Send syslog messages at severity matching their level#8849
beautifulentropy wants to merge 1 commit into
reland-slogfrom
slog-audit/10-blog-syslog-severity

Conversation

@beautifulentropy

@beautifulentropy beautifulentropy commented Jul 6, 2026

Copy link
Copy Markdown
Member

The slog migration (#8606) dialed syslog once at LOG_INFO and pushed every record through plain io.Writer.Write, which stamps the dial-time priority on every message. As a result all lines, including errors and audit errors, arrived at syslog with severity 6, breaking any rsyslog routing or alerting keyed on syslog severity, contrary to the migration's stated goal of leaving log routing unchanged.

Route each record through the severity-specific syslog method (Err, Warning, Info, Debug) matching its slog level, restoring pre-migration behavior.

This PR was generated as part of an audit of #8606 using Claude Fable 5.

The slog migration (#8606) dialed syslog once at LOG_INFO and pushed
every record through plain io.Writer.Write, which stamps the dial-time
priority on every message. As a result all lines, including errors and
audit errors, arrived at syslog with severity 6, breaking any rsyslog
routing or alerting keyed on syslog severity, contrary to the
migration's stated goal of leaving log routing unchanged.

Route each record through the severity-specific syslog method (Err,
Warning, Info, Debug) matching its slog level, restoring pre-migration
behavior. Note for deployment: anything adapted to the flattened
all-INFO behavior since #8606 will see severities change back.
@beautifulentropy beautifulentropy requested a review from a team as a code owner July 6, 2026 19:03
@beautifulentropy beautifulentropy changed the title blog: send syslog messages at severity matching their level blog: Send syslog messages at severity matching their level Jul 6, 2026
@aarongable aarongable changed the base branch from main to reland-slog July 6, 2026 21:20
Comment thread blog/severity.go
Comment on lines +77 to +80
// Enabled reports whether records at the given level would be handled. All
// wrapped handlers share the same level, so consulting one suffices.
func (h *severityHandler) Enabled(ctx context.Context, l slog.Level) bool {
return h.info.Enabled(ctx, l)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love all wrapped handlers sharing the same level. It makes sense for the sake of simplicity, but it's deeply weird to think about what it means for the info handler to have a level of "error". I think this is one of the situations where it might make more sense for this handler to track the enabled level itself. Happy to be convinced otherwise if doing so would be more complex than I'm imagining.

@aarongable aarongable requested review from a team, aarongable and jsha and removed request for a team July 6, 2026 22:00
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.

2 participants