Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Log Db Laravel Package

yoeriboven/laravel-log-db

Store Laravel application logs in the database instead of files. This package adds a database log channel that saves messages, levels, context and timestamps to a queryable logs table, so you can browse, filter and search your logs directly from your app or admin panel.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. laravel-log-db plugs into Laravel's existing Monolog channel abstraction, so it occupies the same architectural slot as the single, daily, or stack drivers — one entry in config/logging.php. That is a low-blast-radius integration point: it can be scoped to specific channels (e.g. a db channel used only for application errors, while framework noise stays on file/stderr) rather than replacing the whole logging stack. For teams running multiple app servers or ephemeral containers, consolidating logs into a shared database removes the "ssh into the box and grep" workflow and makes logs queryable alongside application data. The release itself (3.0) adds no new runtime capability — it is a compatibility alignment release adding Laravel 13 and dropping Laravel 9/10/11.

Integration feasibility. Straightforward: composer require, publish and run the migration, define a channel, point LOG_STACK/LOG_CHANNEL at it. Realistic effort is well under a day for a single environment. The main unknown is the package's write semantics (per-entry synchronous insert vs. batched) and its failure behaviour, which materially affects whether it belongs on the critical path.

Technical risk. Three concerns dominate:

  1. Write amplification. Every log entry becomes a DB round-trip. On a service that logs verbosely or during an incident-induced log storm, this competes with application traffic for connection pool and I/O. Mitigate by scoping the channel to warnings/errors only and/or using a dedicated connection.
  2. Recursive logging / self-inflicted outage. If the database is unavailable, the DB log driver fails — and if that failure is itself logged to the DB channel, you get a loop or a silent black hole. Confirm the package degrades gracefully (falls back to stderr/file) and that queue workers and the exception handler are configured to avoid recursion.
  3. Single-maintainer dependency. This is a small community package. 3.0's EOL-policy alignment is a good hygiene signal, but bus factor should be weighed against building a ~50-line custom Monolog handler in-house.

Key questions. Does it batch writes or insert per record? What are its failure/fallback semantics? Does it store context, stack traces, and exception payloads losslessly, or truncate? Are retention/pruning commands included? Are the timestamp and level columns indexed for query performance? Does it support configurable connections (read/write split, separate log DB)? Is Laravel 12 still supported in the v3 constraint, or is 13-only? What PHP versions are supported?

Integration Approach

Stack fit. Natural fit for any Laravel app on 12 or 13 that currently writes files in containers or across multiple hosts. Poor fit for high-throughput services with very chatty logging, and unnecessary for single-server apps where daily files plus a log shipper already work.

Migration path. The breaking change is a Composer constraint tightening, not an API change — but it is still a hard floor:

  • On Laravel 12 or 13: adopt or upgrade to ^3.0. Low risk; no code changes expected.
  • On Laravel 11 (or below): ^3.0 will not resolve. Pin 2.1.* to stay patched on the last supported branch, and treat the Laravel 12/13 upgrade as the gate.
  • Monorepos / shared internal packages: re-run composer update --dry-run early to surface conflicts where a sibling package still pins an older Laravel range. This is the most likely source of friction, not the package itself.

Compatibility. Verify the full matrix before committing — Laravel version, PHP version, and DB driver (MySQL/Postgres/SQLite) all matter for the migration and for JSON/context column handling. Also confirm interaction with Laravel's stack channel, since most teams will want ["db", "stderr"] rather than a wholesale swap.

Sequencing.

  1. Confirm current Laravel/PHP versions and package constraint resolution on a scratch branch.
  2. Design the channel topology first (which levels go to DB) — this decision bounds every risk above.
  3. Stand up retention/pruning before enabling the channel in production; a log table without a prune job is a disk-space incident on a timer.
  4. Roll out dev → staging → production, watching query latency and table growth for the first full traffic cycle.
  5. Add dashboards/queries for the log table so the team actually uses it; otherwise you've added a write path and kept the old reading habits.

Operational Impact

Maintenance. Low ongoing maintenance. The package tracks Laravel's release cadence, and the 9/10/11 drop is exactly the right hygiene — it keeps the support matrix defensible rather than accumulating untested EOL branches. Counterweight: single-maintainer project, so budget for a contingency (in-house handler) rather than treating it as a foundational dependency.

Support. Aligns with Laravel's own support policy, which simplifies the internal conversation — no need to argue about whether the package supports an EOL framework version; it doesn't, and neither should your app. Document the pinned version per application in an internal registry so teams on Laravel 11 know they are on 2.1.* and why.

Scaling. The scaling surface is the log table, not the app. Expect steady row growth proportional to configured log level; at error-only volume this is usually modest, at debug volume it can be enormous. Needs: an indexed created_at and level, a scheduled prune (or partitioning at higher volumes), and ideally a separate DB connection so log writes cannot saturate the application's primary pool. Read performance degrades gracefully with proper indexing but will eventually need archival.

Failure modes.

  • DB unavailable → logging path fails; confirm fallback and alert on driver errors.
  • Recursive logging → log write failure logged to the log channel; verify guard.
  • Log storm → incident generates volume that slows the DB, generating more errors. Cap with level filtering and rate limiting.
  • Unbounded growth → missing or broken prune job fills disk; alert on table size, not just disk.
  • Silent truncation → large stack traces silently cut, discovered only during a postmortem. Validate payload fidelity before relying on it.

Ramp-up. Developer ramp-up is near zero — it's another channel in a familiar config file. The real ramp-up is procedural: the team must shift from tailing files to writing SQL, which means investing in a handful of saved queries or a lightweight viewer. Without that, adoption will be superficial and the package will be seen as "the thing that fills up the database." The 3.0 upgrade itself requires no training; it requires a version audit.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel
draftsmaninc/draftsman
square-bit/laravel-volition
himito/laravel-mailman
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log