feat(server): support optionally disabling uvicorn access logs#255
Open
fercor-cisco wants to merge 1 commit into
Open
feat(server): support optionally disabling uvicorn access logs#255fercor-cisco wants to merge 1 commit into
fercor-cisco wants to merge 1 commit into
Conversation
Add an `access_log` setting on `LoggingSettings` (default `True`, configurable via `AGENT_CONTROL_ACCESS_LOG`) and plumb it through to `uvicorn.run(..., access_log=...)`. Setting it to `false` suppresses uvicorn's built-in per-request access log regardless of the `configure_logging` path, letting embedders that inject their own request-logging middleware avoid a duplicate line per request. Closes #254 Co-Authored-By: Claude <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fercor-cisco
commented
Jul 24, 2026
fercor-cisco
left a comment
Contributor
Author
There was a problem hiding this comment.
🤖 This review was generated by the Astra agent (claude-opus-4-8). It may contain mistakes.
Verdict: approve — Small, correct, well-tested opt-out for uvicorn access logs; defaults preserve existing behavior and the mechanism matches uvicorn's documented handling of access_log=False.
Follow-ups
Suggested follow-up work that could be tracked as Shortcut stories:
server/README.md:1-1: As the author notes, server config docs are hosted at docs.agentcontrol.dev/components/server (out of repo scope). The new AGENT_CONTROL_ACCESS_LOG setting (and the other logging vars now documented in .env.example) should be reflected there separately.
fercor-cisco
marked this pull request as ready for review
July 24, 2026 22:29
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.
Summary
Adds an
access_logsetting that lets embedders suppress uvicorn's built-in per-request access log, defaulting toTrue(no behavior change for existing users).When
agent_control_serveris embedded in a host that already emits its own structured request log, uvicorn'suvicorn.accessline produces a duplicate per request. The existingAGENT_CONTROL_CONFIGURE_LOGGING=falseopt-out does not stop it — uvicorn'sConfig.configure_logging()unconditionally resetsuvicorn.accessto INFO. The reliable lever is uvicorn'saccess_logkwarg: withaccess_log=False, uvicorn clears the logger's handlers and setspropagate=False, so the line is never emitted.Changes
config.py— addaccess_log: bool = _env_alias_field(True, "AGENT_CONTROL_ACCESS_LOG")toLoggingSettings(matches theconfigure_loggingalias pattern).logging_utils.py— add anaccess_log_enabled()helper mirroringshould_configure_logging(), somain.pyreads logging config via helpers (repo convention) rather than importingLoggingSettingsdirectly.main.py— pass"access_log": access_log_enabled()intouvicorn_kwargsinrun().test_run_uses_settings(its fixed positionalfake_runsignature would otherwise break) to assertaccess_log is True; addtest_run_disables_uvicorn_access_log_when_requested; add default/disable tests intest_config.pyandtest_logging_utils.py..env.example— add a Logging section documentingAGENT_CONTROL_ACCESS_LOGalongside the previously-undocumentedAGENT_CONTROL_LOG_LEVEL,AGENT_CONTROL_LOG_JSON, andAGENT_CONTROL_CONFIGURE_LOGGING.Acceptance criteria
access_logsetting onLoggingSettings, defaulting toTrue.AGENT_CONTROL_ACCESS_LOG.AGENT_CONTROL_ACCESS_LOG=false, nouvicorn.accessline is emitted, whetherconfigure_loggingis on or off.uvicorn.error, application loggers) unaffected..env.example.Testing
All 47 tests across the affected suites pass (
test_config.py,test_main_lifespan.py,test_logging_utils.py), run against a local dev Postgres.Notes
server/README.mddefers config docs tohttps://docs.agentcontrol.dev/components/server(out of repo scope) — worth updating there separately as a follow-up.Closes #254
🤖 Generated with Claude Code