You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### What changes were proposed in this pull request?
- Add `conf/logging_conf.yaml.template`: Python `dictConfig` YAML with
`console` (stderr) + `RotatingFileHandler` at
`./hypervisor-logs/hypervisor.log` (10 MB, 5 backups)
- Rewrite `_configure_logging()` in `__main__.py`: loads YAML from
config dir, auto-creates log directories, prints startup notice to
stderr before logger init; `--log-level` now overrides config-file level
instead of being the sole source
- Fill key-path log gaps:
- `protocol/dispatcher.py`: per-request `method`, `request_id`,
`status`, `duration_ms`
- `policy/enforcer.py`: WARNING on access-denied, DEBUG on
access-granted and role resolution
- `handlers/ping.py`, `handlers/initialize.py`, `handlers/execute.py`:
lifecycle logs
- `manifest/yaml_provider.py`: `backends=N, resources=N` counts on load
- `backends/rdbms/backend.py`: query completion with timing and row
count
- Update README with Logging Configuration section
### Why are the changes needed?
Fix: #70
The server had no file logging and several critical paths produced no
log output, making it difficult to diagnose issues in deployed
environments.
### Does this PR introduce _any_ user-facing change?
- New CLI default behavior: logs are now written to
`./hypervisor-logs/hypervisor.log` (relative to CWD) in addition to
stderr. The directory is created automatically.
- `--log-level` now overrides the config-file level rather than being
the sole source of truth.
- New file `conf/logging_conf.yaml.template` can be copied to the config
directory as `logging_conf.yaml` to customise log format, rotation, and
level.
### How was this patch tested?
- All 624 unit tests pass (`uv run python -m unittest discover -s tests
-v`)
- `uv run black . && uv run ruff check . && uv run mypy` — all clean
- Live server smoke test with localfs backend: confirmed
`hypervisor-logs/hypervisor.log` is created in CWD, stdout contains only
JSON-RPC responses, all key-path logs appear in both stderr and file
(startup, manifest load, backend connect, request dispatch with timing,
policy role resolution, execute with row count, graceful shutdown)
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments