feat(api): less verbose uvicorn logs #7466
Merged
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
feat(api): less verbose uvicorn logs
Uvicorn's logging is rather verbose. This change adds a
log_level_network
config setting to independently control uvicorn's log outputs. The setting defaults to warning.The change hides this helpful startup message that says the host and port we are running on:
The ASGI lifespan handler is updated to log a similar message on startup, regardless of log level settings:
Besides being helpful, the launcher relies on a message like this to launch the app. So, previously, if the user set their log level to anything above info (e.g. warning or error), the launcher would fail to open the app. This change prevents that edge case. The launcher will be updated to handle the altered format ("Uvicorn" -> "Invoke").
feat(app): change queue item execution log from debug to info
This provides useful context for subsequent logs during queue item execution.
Related Issues / Discussions
n/a
QA Instructions
log_level: error
ininvokeai.yaml
. You should still see a message like[2024-12-20 08:04:04,928]::[InvokeAI]::INFO --> Invoke running on http://0.0.0.0:9090 (Press CTRL+C to quit)
on startup.log_level_network: info
ininvokeai.yaml
. You should see the traditional invoke logsplosion.Merge Plan
I'll do a release.
Checklist