blog: Send syslog messages at severity matching their level#8849
Open
beautifulentropy wants to merge 1 commit into
Open
blog: Send syslog messages at severity matching their level#8849beautifulentropy wants to merge 1 commit into
beautifulentropy wants to merge 1 commit into
Conversation
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.
aarongable
reviewed
Jul 6, 2026
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) |
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.