Skip to content

Conversation

czechboy0
Copy link
Contributor

Motivation

Proving out how a live-configurable log handler could work, which can control the log level using a hot-reloaded configuration value.

This can be super useful in production systems when an issue is being observed and you'd want to emit more logs to debug it, without restarting the server.
Or, if a server is running under high load, this can be used to reduce the log level to create more CPU headroom.

Modifications

Added a type that is both a Service and a LogHandler, watching the value logLevel from a provided ConfigReader.

Result

A new type that can be used with Swift Log.

Test Plan

Only a proof-of-concept, haven't tested it much yet, looking for feedback if this is useful and if we should put more energy into cleaning it up and adding it.

@czechboy0 czechboy0 added the status/needs-design Needs further discussion and a concrete proposal. label Oct 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/needs-design Needs further discussion and a concrete proposal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant