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 Fluent Logger Laravel Package

ytake/laravel-fluent-logger

Laravel package that integrates Fluentd logging into your app. Configure a Fluentd channel in config/logging.php and ship structured logs to your aggregator via fluent-logger, with a service provider and facade for quick, minimal setup.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. ytake/laravel-fluent-logger is a thin adapter: it registers a Laravel logging channel that wraps a Monolog handler, which in turn uses the official fluent/logger client to ship records to Fluentd over the forward protocol (TCP 24224 or a Unix socket, MessagePack-encoded). It has no domain coupling and no invasive service-provider magic beyond Log::extend-style channel registration, so it sits cleanly at the observability edge of the application. The important caveat is that fit is a function of deployment topology, not code quality: this package makes the PHP process itself a network client of Fluentd. That is idiomatic for VM/bare-metal Laravel with a co-located td-agent, and it is against the grain for containerized/Kubernetes deployments, where the convention is "log to stdout and let a node-level DaemonSet (Fluent Bit/Fluentd) collect." In that world the package adds a blocking network hop the platform didn't ask for. 8.0.0 does not change this assessment — it is a compatibility release, not an architectural one.

Integration feasibility. Low effort. composer require ytake/laravel-fluent-logger, publish config, add a fluent channel to config/logging.php, reference it from a stack. Lumen needs manual $app->register(...) in bootstrap/app.php. A competent Laravel engineer has a working proof of concept in under a day; the work is in Fluentd-side configuration (match/tag routing, buffering, outputs), not in the PHP package.

Technical risk.

  • Adoption and bus factor. 62 stars, zero dependents, effectively one maintainer. This remains the dominant risk, but two things soften it: the code is MIT and a few hundred lines (forking and vendoring is cheap), and 8.0.0 was authored by a second contributor (@fish3046), which is the first evidence of anyone besides the maintainer touching the repo. Treat it as "adopt the pattern, not the vendor."
  • Dependency compatibility — materially improved by 8.0.0, but verify the mechanics. The release explicitly claims Laravel 12 test support. Laravel 12 implies Monolog 3 and PHP 8.2+, so the single biggest gating question from the prior assessment (Monolog 3 handler contract compatibility) is now evidenced by a passing test matrix rather than assumed. Two caveats: (a) the changelog lists only a test fix, so confirm whether runtime code changed at all or whether this is a composer.json constraint edit wearing a major version; (b) a major bump implies something broke — most likely illuminate/* was narrowed to ^12.0, dropping older Laravel support. If so, teams on Laravel 10/11 must pin ^7.0, and teams on Laravel 12 must take ^8.0. Read the 7.0.0...8.0.0 diff before assuming a drop-in upgrade.
  • Blocking I/O on the request path. The forward protocol is synchronous. Logging becomes a network operation on every record, with connect/write timeouts on the critical path. Unchanged by this release.
  • Long-lived workers. Under Octane/RoadRunner/Swoole, a naively cached client/connection can go stale after fork or idling, producing either silent loss or exceptions in the worker. Unchanged; the Laravel 12 test fix says nothing about Octane lifecycle behavior.
  • Test coverage and CI matrix is still not evident from the outside, but the fact that the release is about the CI matrix is a weak positive — someone is running the suite against a current framework.

Key questions to resolve before committing.

  1. What are the exact illuminate/*, monolog/monolog, and php constraints, and does the handler extend AbstractProcessingHandler in a Monolog-3-compatible way? Largely answered by 8.0.0 (Laravel 12 ⇒ Monolog 3 ⇒ PHP 8.2+), subject to reading the tag's composer.json.
  2. New: Did 8.0.0 widen the constraints (^10|^11|^12) or narrow them (^12 only)? This determines whether it is a safe composer update or a hard fork in the road that strands Laravel 10/11 services on 7.x.
  3. New: Does the 8.0.0 diff contain any runtime/source change, or only tests/ and composer.json? If only tests changed, the major bump is a constraint declaration and the runtime risk profile of 7.0.0 carries over verbatim — including any unresolved failure-mode behavior.
  4. Does the channel register through config/logging.php custom drivers (Laravel 5.6+), or does it rely on the deprecated configureMonologUsing hook?
  5. What happens when Fluentd is unreachable — throw, swallow, or block until timeout? What are the configurable timeouts?
  6. Connection lifecycle: per-record, per-request, or singleton? Does it reconnect after failure?
  7. Is there any buffering/batching, and is the buffer bounded?
  8. Are event timestamps taken from the Fluentd time field or from the PHP clock (skew implications)?
  9. Is 8.0.0 a one-off community contribution or the start of a cadence? One PR is a data point, not a trend.

Integration Approach

Stack fit. Revised upward: Laravel 10–12 (12 confirmed by the 8.0.0 test fix; 10/11 only if the constraint permits), PHP 8.2+ on the 8.x line, Monolog 3. If you are on Laravel 8/9 or PHP 8.1, you are on the 7.x line and should assume the Monolog 3 question is unanswered for you. Fits naturally if you already operate Fluentd and want tag-based routing to Elasticsearch/OpenSearch, BigQuery, S3, or Kafka without writing a custom handler. Fits poorly if your platform team's logging standard is stdout-only.

Migration path. Do not swap the default channel. Add fluent as an additional channel and attach it to a stack alongside the existing daily/stderr channel for a defined overlap period. This gives you a zero-downtime rollback (drop the channel from the stack) and a ground truth to diff against. Only after parity is demonstrated should the file channel be demoted to error-only.

Upgrade sequencing for 7.x → 8.x. Treat this as a version-line decision, not a patch. Inventory every service pinned to the package and its Laravel version first; the 8.0.0 bump likely splits your estate into "Laravel 12 / package 8.x" and "Laravel ≤11 / package 7.x." That is acceptable — the package is small and the two lines differ mainly in constraints — but it must be deliberate, because a shared internal fork or a shared composer.lock template will otherwise force an unintended framework upgrade. Resolve question 2 before the first composer update in CI, or you will discover the split via a red build.

Compatibility checks to run as gates, not as hopes.

  • Diff 7.0.0...8.0.0 and read composer.json at the tag before installing anything.
  • Install into a throwaway app on your exact Laravel/PHP/Monolog versions; confirm the channel resolves and a record arrives.
  • Exercise it under Octane/your worker model if applicable, including after php artisan octane:reload.
  • Confirm behavior with LOG_CHANNEL=stack and with LOG_LEVEL filtering, since Monolog level handling is a common source of "why is nothing arriving."
  • Confirm the app still boots and serves when Fluentd is stopped (this is the acceptance test that matters most, and 8.0.0 does not claim to have touched it).

Sequencing.

  1. Spike (1 week). Diff the release, then sandbox app → local Fluentd → verify record shape, tags, timestamps, and failure behavior with Fluentd killed mid-run.
  2. Shadow mode (2–4 weeks). One low-risk internal service emits to both file and Fluentd. Compare volume and content; measure p50/p99 added latency and connection counts on Fluentd.
  3. Canary (2 weeks). Make Fluentd the primary sink for that service; keep file logging at error.
  4. Broaden. Roll to services by criticality, not by convenience, with a documented rollback.
  5. Decommission the redundant file pipeline in the migrated services.

Operational Impact

Maintenance. You are taking on two maintenance surfaces, not one: the PHP package (and its fluent/logger transitive dependency) and the Fluentd deployment. The first is cheap — the code is small and forkable — and 8.0.0 is the first concrete signal that the package tracks new Laravel majors rather than being abandoned. But the signal is thin: the work was a test-matrix fix contributed by a community member, not a maintainer-led modernization, and it arrived as a major bump that strands older framework versions. Keep the annual "does it still install on the current framework" check, and keep the pre-authorization to fork into a vendor namespace if the maintainer goes quiet again.

Support. No commercial backing, no SLA, single-author response times. Internal ownership is still mandatory; there is no one to escalate to at 3 a.m. The team owning this should be the same team that owns the Fluentd configuration, otherwise you get the classic split where app engineers blame the log pipeline and platform engineers blame the app.

Scaling. The scaling unit is connections, not throughput. Each PHP-FPM worker (or Octane worker) holds its own socket to Fluentd, so a 200-worker fleet means 200 persistent connections to a single Fluentd node — plan a Fluentd aggregator tier or a load-balanced endpoint, and watch ulimit/file descriptors on both sides. Per-request latency increases by roughly one local-network write plus serialization; measure it, don't estimate it. Throughput is generally fine because Fluentd buffers, but that buffer is on the Fluentd side; the PHP side has little to absorb a burst.

Failure modes to design against.

  • Fluentd down or slow → synchronous connect/write blocks request threads; if the handler throws, requests 500. If it swallows, you lose logs silently. Neither default is acceptable without explicit configuration and a documented choice. Nothing in 8.0.0 suggests this behavior changed — re-verify it rather than inheriting the prior test result.
  • Stale connections after fork/reload → write to a dead socket, first record lost or an exception in an Octane worker.
  • MessagePack/version mismatch between the PHP client and Fluentd's forward protocol → malformed or rejected records, often without a loud error.
  • Clock skew → records routed to the wrong time bucket in downstream stores if the timestamp is taken PHP-side.
  • Silent tag misconfiguration → logs land in Fluentd but match no <match> block and are dropped, which looks exactly like "the app isn't logging."
  • Cascading backpressure if Fluentd's output (ES/BigQuery) is slow and its buffer fills — this surfaces as app latency, which is a surprising place to find a search-cluster problem.
  • New in 8.x: version skew across the estate. Two services on different package lines with different Monolog majors will not behave identically under the same LOG_LEVEL/stack config, which makes "logging is broken everywhere" investigations harder to reason about. Pin explicitly per service.

Ramp-up. Low for application engineers — the package is a config change and the Laravel logging abstractions are familiar. The real learning curve is Fluentd: tags, match routing, buffer/flush/retry semantics, and how to prove a log line reached its destination end-to-end. That is a platform-team skill, not an app-team one. Produce two artifacts before rollout: a one-page runbook ("Fluentd unreachable — what to check, what to expect from the app") and a smoke test that emits a uniquely-tagged record and asserts its arrival downstream. Without the latter, every future logging incident becomes an argument about whose layer is broken.

Recommendation. Adopt if you already run Fluentd and are on VMs or a non-Kubernetes runtime with a local agent; the package is a reasonable, replaceable adapter and the cost of entry is a day. 8.0.0 makes it a viable choice for Laravel 12 teams for the first time, which is a genuine change from the prior assessment — but read the diff before trusting the major version's semantics. Do not adopt as a way to introduce structured logging into a container platform — in that case, log to stdout and let the node collector do the forwarding, and spend the effort on your Fluent Bit/Fluentd configuration instead. Either way, resolve the constraint-widening question and the failure-mode behavior before this appears in a production stack channel.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib