Skip to content

Conversation

psychedelicious
Copy link
Collaborator

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:

Uvicorn running on http://0.0.0.0:9090/ (Press CTRL+C to quit)

The ASGI lifespan handler is updated to log a similar message on startup, regardless of log level settings:

Invoke running on http://0.0.0.0:9090 (Press CTRL+C to quit)

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

  • Start the app. You should see far fewer spurious logs.
  • Generate. You should see logs for each queue item / session being executed.
  • Set log_level: error in invokeai.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.
  • Set log_level_network: info in invokeai.yaml. You should see the traditional invoke logsplosion.

Merge Plan

I'll do a release.

Checklist

  • The PR has a short but descriptive title, suitable for a changelog

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 the helpful startup message that says the host and port we are running on.

For example: `Uvicorn running on http://0.0.0.0:9090 (Press CTRL+C to quit`

The ASGI lifespan handler is updated to log an equivalent 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.
This provides useful context for subsequent logs during queue item execution.
@github-actions github-actions bot added python PRs that change python files services PRs that change app services labels Dec 19, 2024
@psychedelicious psychedelicious enabled auto-merge (rebase) December 19, 2024 22:15
@psychedelicious psychedelicious merged commit a9a6720 into main Dec 19, 2024
14 checks passed
@psychedelicious psychedelicious deleted the psyche/feat/api/less-verbose-uvicorn-logs branch December 19, 2024 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
python PRs that change python files services PRs that change app services
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants