Skip to content

Make Sure Logs Are Sent To The Right Place - #229

Merged
gwynne merged 4 commits into
mainfrom
fix-transaction-request-logger
Sep 23, 2026
Merged

gwynne merged 4 commits into
mainfrom
fix-transaction-request-logger

Conversation

@0xTim

@0xTim 0xTim commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

These changes are now available in 2.13.1

Fixes an issue where logs weren't being sent to the right place in closures.

Resolves #228

@0xTim
0xTim requested a review from gwynne as a code owner September 23, 2026 11:45
@0xTim 0xTim added the semver-patch Internal changes only label Sep 23, 2026
closure(
_FluentPostgresDatabase(
database: underlying.sql(
database: underlying.logging(to: self.logger).sql(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be nice if we could fix the larger issue with the various versions of logging(to:) in FluentKit and SQLKit; thanks to protocol dispatch rules, it tends not to work with some APIs. But I think that will require API breakage to deal with.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah once everything is swift concurrency we can just rely on Logger.current, which is what we do in Vapor 5, resolves so many of these issues

@gwynne
gwynne enabled auto-merge (squash) September 23, 2026 11:54
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.79%. Comparing base (69f7d3d) to head (c808aed).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #229   +/-   ##
=======================================
  Coverage   59.79%   59.79%           
=======================================
  Files          12       12           
  Lines         582      582           
=======================================
  Hits          348      348           
  Misses        234      234           
Files with missing lines Coverage Δ
.../FluentPostgresDriver/FluentPostgresDatabase.swift 64.91% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gwynne
gwynne merged commit b5d2314 into main Sep 23, 2026
10 checks passed
@gwynne
gwynne deleted the fix-transaction-request-logger branch September 23, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver-patch Internal changes only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong request-id in database query logs

2 participants