Skip to content

BUG: Uvicorn startup logs confusingly labeled as [error] #1172

@rohan-pandeyy

Description

@rohan-pandeyy

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

When starting the backend and sync-microservices services using fastapi dev commands, the startup logs from Uvicorn (e.g., "Started server process") are prefixed with [error]. This is misleading as these are standard informational logs, not errors.

Image

Steps to Reproduce

  1. Start the backend service: fastapi dev --port 52123.
  2. Observe the console output during startup.
  3. Start the sync-microservices service: fastapi dev --port 52124.
  4. Observe the console output during startup.

Expected Behavior

The logs should be labeled with [uvicorn] or a similar neutral tag, indicating the source of the log without implying an error severity.

Example:

[BACKEND] | [uvicorn] | INFO | Started server process [12345]

This issue appears to be a regression introduced in PR #940. Previously, the InterceptHandler explicitly prepended [uvicorn] to the log messages:

logger.log(record.levelno, f"[uvicorn] {msg}")

The refactoring to avoid recursion changed this logic to derive the tag from the logger name (uvicorn.error -> error), causing the misleading [error] tag.

Record

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions