Skip to content

Use Logfire directly for application logging#85

Merged
Subhransu-De merged 2 commits into
mainfrom
issue-19-observability-correlation
Jul 12, 2026
Merged

Use Logfire directly for application logging#85
Subhransu-De merged 2 commits into
mainfrom
issue-19-observability-correlation

Conversation

@Subhransu-De

Copy link
Copy Markdown
Owner
  • Use direct Logfire calls for application lifecycle and exception events.
  • Keep the stock Logfire handler for Uvicorn and third-party logs with health filtering.
  • Remove the duplicate JSON logging path and refresh tests and the issue audit.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80fcc6e306

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/main.py
Comment on lines +30 to +34
logfire.info(
"Starting up {service_name} on port {port}",
service_name=app_settings.app_name,
port=app_settings.port,
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve logs when Logfire is not configured

In the default Compose/container path no LOGFIRE_TOKEN is supplied, and configure_otel() sets send_to_logfire="if-token-present" with console=False. After replacing the stdout-backed logger.info/logger.exception path with direct logfire.* calls, lifecycle and unhandled-exception diagnostics are silently dropped unless a Logfire token is configured, which makes default local/container failures much harder to diagnose. Please keep a stdout/stderr fallback or only route these messages exclusively through Logfire when an exporter is actually configured.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enabled Logfire console output without a token so local and container diagnostics remain visible.

@sonarqubecloud

Copy link
Copy Markdown

@Subhransu-De Subhransu-De merged commit 6a6c5f8 into main Jul 12, 2026
31 checks passed
@Subhransu-De Subhransu-De deleted the issue-19-observability-correlation branch July 12, 2026 11:46
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