Skip to content

Commit 0e7715b

Browse files
committed
Push the logging to the background, after the response has been sent
1 parent c1d0e31 commit 0e7715b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# CHANGELOG
22

3-
## [v1.3.x (Unreleased)](https://github.com/onlime/laravel-sql-reporter/compare/v1.3.1...main)
3+
## [v1.3.x (Unreleased)](https://github.com/onlime/laravel-sql-reporter/compare/v1.3.2...main)
4+
5+
## [v1.3.2 (2025-04-16)](https://github.com/onlime/laravel-sql-reporter/compare/v1.3.1...v1.3.2)
6+
7+
- Push the logging to the background, after the response has been sent, using Laravel's [`defer()`](https://laravel.com/docs/12.x/helpers#deferred-functions) helper.
8+
- Declare PHP `strict_types` in all classes.
49

510
## [v1.3.1 (2025-02-21)](https://github.com/onlime/laravel-sql-reporter/compare/v1.3.0...v1.3.1)
611

src/Listeners/LogSqlQuery.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function handle(CommandFinished|RequestHandled $event): void
2929
return;
3030
}
3131

32-
$this->logger->log();
32+
// Push the logging to the background, after the response has been sent.
33+
defer(fn () => $this->logger->log())->always();
3334
}
3435
}

0 commit comments

Comments
 (0)