✨ Add access logs to serve commands and auth_proxy log target#15
Merged
Conversation
Unify metrics/current/font serving behind internals/server.Serve, which wraps every handler in one access-log middleware emitting a per-request line (method, path, status, duration, remote, size) through the logger so it stays ws-cli logs --level filterable. Add the auth_proxy target to ws-cli logs over q2.37's existing oauth2-proxy log file. Bump to 0.0.58.
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.
Unify
serve metrics/current/fontbehind a singleinternals/server.Serve(cfg, handler, description, w)chokepoint that wraps every handler in one access-log middleware. Each request emits a line —method path status duration remote size— throughinternals/logger.Log(levelinfo, stamped) so it parses against the logger regex and staysws-cli logs --level=filterable. No third-party framework; stdlib + existingpromhttp/logger.Also adds the
auth_proxytarget tows-cli logs, reading q2.37's existing oauth2-proxy log file (logging.auth_proxy_file); the target maps 1:1 to the YAML key via the existingtarget+"_file"resolution.ServeDirectorycollapses to a thin caller ofServe. Bumps version to0.0.58.Tests:
internals/server/access_log_test.go(status/size capture table, line format/parseability, serves-and-logs);cmd/logs/logs_test.goextended with theauth_proxytarget.