Skip to content

logging: add configurable log file level, default to INFO - #11

Merged
martinhanzik merged 1 commit into
mainfrom
logging-file-level
Jun 30, 2026
Merged

logging: add configurable log file level, default to INFO#11
martinhanzik merged 1 commit into
mainfrom
logging-file-level

Conversation

@martinhanzik

Copy link
Copy Markdown
Contributor

The log file handler was hardcoded to DEBUG whenever a log file was configured. On a busy deployment this is a lot of volume, most of it the per-message firehose (send/receive/write lines) that is only useful when debugging the wire protocol.

Add a log.level config option (under the existing log: section, values debug or info) controlling the file handler level, and change the default to INFO so the file is readable out of the box.

Note: this is a behavioral change. A deployment that configured a log file specifically to capture DEBUG now gets INFO unless it adds log.level: debug. The --verbose/-v flag only affects the stderr handler, not the file, so it does not restore debug-in-file either.

Also demote three per-connection server log lines (client connected, client closed, closing connection) from INFO to DEBUG: agents reconnect on every send retry and every rename, so these are routine churn rather than noteworthy events and would otherwise dominate the INFO file log.

While here, harden the log: config access against a bare log: key (YAML null), which the new always-evaluated level lookup would otherwise turn into an AttributeError.

Claude-Session: https://claude.ai/code/session_0168heNfiwZUhaUxzU8qhNY6

The log file handler was hardcoded to DEBUG whenever a log file was
configured. On a busy deployment this is a lot of volume, most of it the
per-message firehose (send/receive/write lines) that is only useful when
debugging the wire protocol.

Add a `log.level` config option (under the existing `log:` section,
values `debug` or `info`) controlling the file handler level, and change
the default to INFO so the file is readable out of the box.

Note: this is a behavioral change. A deployment that configured a log
file specifically to capture DEBUG now gets INFO unless it adds
`log.level: debug`. The `--verbose`/`-v` flag only affects the stderr
handler, not the file, so it does not restore debug-in-file either.

Also demote three per-connection server log lines (client connected,
client closed, closing connection) from INFO to DEBUG: agents reconnect
on every send retry and every rename, so these are routine churn rather
than noteworthy events and would otherwise dominate the INFO file log.

While here, harden the `log:` config access against a bare `log:` key
(YAML null), which the new always-evaluated level lookup would otherwise
turn into an AttributeError.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0168heNfiwZUhaUxzU8qhNY6
@martinhanzik
martinhanzik merged commit d8e8b9e into main Jun 30, 2026
20 checks passed
@martinhanzik
martinhanzik deleted the logging-file-level branch June 30, 2026 10:54
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