Releases: onlime/laravel-sql-reporter
Releases · onlime/laravel-sql-reporter
v1.3.0
v1.2.3
- Made datetime format of formatted header configurable and added TZ offset to default format
Y-m-d H:i:s P
. - Fix | Prevent duplicate logging when a console command is called from a regular web request (e.g. programmatically executing an Artisan command with
Artisan::call()
). In web context, we're now only logging onRequestHandled
event, while in console only onCommandFinished
event.
v1.2.2
- The
Writer
object now has a staticshouldReportSqlQuery()
method to define a custom callback for filtering queries included in theQueryLogWritten
event. by @pascalbaljet in #4 - The
SqlQuery
object is now areadonly
class, and all the getter methods have been removed. This is a breaking change. - The
SqlQuery
object now includes the unprepared query and bindings. - Added tests for the reporting mechanism and the
QueryLogWritten
event - Drops support for 8.1
v1.2.1
v1.2.0
- Feature | Dispatch
QueryLogWritten
event after writing queries to the log, so that the whole query log can be accessed for further processing, e.g. generating reports/notifications. - Feature | Added auth guard information to log headers.
- Laravel 11 support.
- Migrated to Pest for testing (by @pascalbaljet in #2)
- Added GitHub actions for all supported Laravel and PHP versions.
- Introduced
orchestra/testbench
dev dependency instead of the whole Laravel framework. - Improved Service Provider: fixed the publish tag and use the regular base
ServiceProvider
. - Improved
WriterTest
by not mocking theConfig
class but using the real config values.
v1.1.0
- Drop Laravel 9 support, require Laravel v10.15 or higher for the new
DB::getRawQueryLog()
support. - PHP code style fixes by
laravel/pint
v1.10, now using more strict style rules (laravel
preset). - Refactored whole codebase from
DB::getQueryLog()
to use the newDB::getRawQueryLog()
method, soReplacesBindings
is no longer needed. - Replaced torann/geoip by stevebauman/location for optional GeoIP support.
- Improved username detection in
Formatter
headers, so that it works both with defaultemail
field or customusername()
method onUser
model.
v1.0.1
v1.0.0
v0.9.1
Added
- Added new config param
queries.exclude_pattern
(env varSQL_REPORTER_QUERIES_EXCLUDE_PATTERN
) to narrow down queries to be logged without bloating include pattern regex. - Added unit tests for
Writer
, testing query include/exclude patterns and min exec time.
Changed
- Renamed
SQL_REPORTER_QUERIES_PATTERN
env var toSQL_REPORTER_QUERIES_INCLUDE_PATTERN
- Renamed methods in
Writer
for clarity. - Improved testability of
Writer::writeQuery()
by returning true if query was written to log.