onamfc/laravel-devlogger
Laravel DevLogger stores application logs in the database with automatic exception catching, tagging, queue and request/user context, advanced filtering, and configurable retention cleanup. Easily configurable via environment variables.
devlogger:cleanup --days had no effect on what was deleted.
The command read the option, printed it, and counted the dry run against it — then called DevLogger::cleanup() with no arguments, and cleanup() re-read devlogger.retention_days for itself. The option changed the output and nothing else. It is now passed through, alongside a new --chunk.
Cleanup did not actually remove anything.
cleanup() deleted through the model, and DeveloperLog applies SoftDeletes — so it only stamped deleted_at. Expired logs stayed in the table, kept occupying disk, and were re-stamped on every subsequent run. Deletion now goes through the query builder, which also clears rows the old behaviour stamped and abandoned.
Verified on an in-memory database — 80 rows, retention 30, cleanup(10):
| old | fixed | |
|---|---|---|
| reported deleted | 29 | 65 |
| rows remaining | 80 | 15 |
| left soft-deleted | 40 | 0 |
Deletion is chunked (1000 rows per statement, --chunk to override). A table that has gone unattended is exactly the case that breaks a single unbounded DELETE — it builds a transaction large enough to time out and roll the whole thing back. Each chunk now commits on its own, so an interrupted run keeps what it removed.
cleanupCandidates(?int $days = null) — the count a cleanup would remove, soft-deleted rows included, so --dry-run agrees with a real run.
If you have been running devlogger:cleanup, your table likely holds a backlog of soft-deleted rows that were never removed. The first run on this version clears them, so expect it to delete far more than usual. DELETE does not return disk to the OS — follow with OPTIMIZE TABLE developer_logs to reclaim it.
This release focuses on improving the installation and setup experience for the Laravel DevLogger package, specifically addressing issues with publishing configuration and migrations.
Fix incorrect path resolution for Packagist installs
Bump version for packagist
Update the path reference to the config and migration files
Resolved PHP 8.3 deprecation warning: Updated method signature of markAsClosed() in DeveloperLog model to explicitly declare $userId as a nullable integer (?int $userId = null). This change prevents the deprecation notice: "Implicitly marking parameter $userId as nullable is deprecated", which occurs in PHP 8.3 and later.
Update readme file for Laravel 12 support
The fix uses conditional logic to handle both cases:
This approach avoids trying to assign the facade to a variable, which isn't supported in PHP, and ensures compatibility with Laravel 12's stricter requirements.
Addresses the issue with Laravel 12 has chaning the Schema::connection() method to require a connection name parameter, whereas in previous versions it could be called without arguments to use the default connection.
bump version to sync with packagist
The updated package will still work with Laravel 9, 10, and 11 while being ready for Laravel 12. The changes use patterns that are available across all supported versions.
How can I help you explore Laravel packages today?