Skip to content

✨ Add access logs to serve commands and auth_proxy log target#15

Merged
bdsoha merged 1 commit into
mainfrom
feature/access-log
Jun 3, 2026
Merged

✨ Add access logs to serve commands and auth_proxy log target#15
bdsoha merged 1 commit into
mainfrom
feature/access-log

Conversation

@bdsoha

@bdsoha bdsoha commented Jun 3, 2026

Copy link
Copy Markdown
Member

Unify serve metrics/current/font behind a single internals/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 — through internals/logger.Log (level info, stamped) so it parses against the logger regex and stays ws-cli logs --level= filterable. No third-party framework; stdlib + existing promhttp/logger.

Also adds the auth_proxy target to ws-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 existing target+"_file" resolution.

ServeDirectory collapses to a thin caller of Serve. Bumps version to 0.0.58.

Tests: internals/server/access_log_test.go (status/size capture table, line format/parseability, serves-and-logs); cmd/logs/logs_test.go extended with the auth_proxy target.

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.
@bdsoha bdsoha merged commit 43fa127 into main Jun 3, 2026
3 checks passed
@bdsoha bdsoha deleted the feature/access-log branch June 3, 2026 13:45
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.

1 participant