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

hhxsv5/laravel-kafka-logger

A Laravel logging channel that streams application logs directly to Apache Kafka topics, enabling centralized, real-time log collection and processing through Kafka consumers and downstream data pipelines.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. hhxsv5/laravel-kafka-logger is a thin Laravel logging channel that publishes log records to Kafka. Architecturally it slots in exactly where an existing stack/single/daily channel does: it registers a custom Monolog handler that wraps a Kafka producer and forwards formatted records to a topic. That means it is a destination swap, not a platform component — it does not provide schema registry integration, consumer tooling, batching guarantees beyond what the underlying client offers, retry/backoff policy, or dead-letter handling. Its value is entirely derived from the fact that the application already treats logs as an event stream rather than a file. If the platform's logging standard is still "ship to stdout and let the log shipper handle it," this package is redundant; if the platform has an established Kafka-based observability or audit pipeline, it is a plausible fit at the channel layer only.

Integration feasibility. Low effort, high uncertainty. Configuration is a small block in config/logging.php and a couple of environment variables; no service provider changes, no queue worker, no artisan commands. The producer dependency is the real integration surface: the package's composer.json pins the older nmred/kafka-php-style ecosystem rather than rdkafka (ext-php-rdkafka) or a maintained modern client, so the actual work is validating that a compatible producer can be installed against the target PHP/Laravel version, and that the broker connection (SASL, TLS, bootstrap servers) is expressed in the format the underlying client understands rather than the format modern Kafka teams expect. Expect the integration cost to be concentrated in dependency resolution and broker auth configuration, not in wiring the channel.

Technical risk. This is the dominant consideration and it is high across several dimensions:

  • Viability. 10 stars, a single maintainer, last release July 2020, and a score of 0.05 indicate effectively an abandoned package. Laravel's logging internals have moved a long way since 2020 (channel construction, Monolog major versions, context/extra handling, Psr\Log v3). Compatibility with current Laravel is unverified rather than promised.
  • Bus factor. One. If the package breaks against a Laravel upgrade, the fix is ours to write, in a codebase we did not author, with no upstream review process.
  • Delivery semantics. Logging to Kafka over a synchronous producer inside the request path introduces broker latency into request latency, and the failure mode when the broker is unreachable is exactly the case you least want a logging call to be making decisions about. Whether failures throw, are silently swallowed, or are buffered is not something the README-level surface of this package gives confidence in.
  • Supply chain. An unmaintained package with a small transitive dependency tree is a low-effort but nonzero attack surface, and it will not receive security patches. Vendor risk here is trivial in severity but permanent in duration.
  • Licensing. MIT — no issue.

Key questions. These need answers before any adoption decision, and most of them are cheap to answer:

  1. What is the actual business driver — audit/compliance retention, SIEM ingestion, or generic application logs? Only the first two plausibly justify Kafka as a direct-from-app sink.
  2. Can the same outcome be achieved with the existing log shipper (stdout → Fluent Bit/Vector → Kafka)? That is the default answer and it removes this dependency entirely.
  3. Which Kafka client does the platform standardize on, and does this package's client support the cluster's auth (SASL/SCRAM, mTLS) and required TLS version?
  4. What are the required delivery semantics — at-most-once acceptable for operational logs, or at-least-once required for audit records? Does the package expose that control, or is it fixed?
  5. What is the behavior under broker unavailability: block the request, drop the record, or buffer? Is there a bounded buffer?
  6. Does the package work on our current Laravel/PHP versions, and if not, what is the patch cost versus a ~150-line in-house Monolog handler?
  7. What is the topic naming/partitioning convention, and does the package allow a partition key (e.g., tenant or request id) to preserve per-entity ordering?
  8. Is anyone else in the ecosystem depending on this, or would we be the largest consumer by an order of magnitude?

Integration Approach

Stack fit. Poor-to-conditional. The package fits a Laravel monolith or service that already emits structured logs and already has network egress to a Kafka cluster. It does not fit containerized workloads whose logging contract is stdout/stderr, where the platform's log collector is the correct place to make routing decisions. The honest framing to stakeholders: this package moves the Kafka dependency into the application, which is a step backwards in most modern deployment topologies.

Migration path. If adopted, keep it strictly additive and reversible:

  1. Add the channel alongside existing channels; do not modify the default channel.
  2. Route a named subset of traffic to it — a dedicated log channel used explicitly by the services that need Kafka delivery (Log::channel('kafka')->info(...)), not a blanket default.
  3. Leave LOG_CHANNEL and the shipper path untouched so rollback is a config revert, not a code revert.
  4. Only after measured stability (see sequencing) consider moving it into a stack channel.

If the platform standard is stdout-based collection, the migration path is not to this package at all — it is a Fluent Bit/Vector Kafka output, which is a config change in infrastructure rather than a dependency change in every service.

Compatibility. Verify explicitly, not by inference: PHP version, Laravel major, Monolog major, and the version of the underlying Kafka producer library against the target broker version. The 2020 release date means the package predates several breaking changes in Laravel's logging stack; assume incompatibility until a spike proves otherwise. Also confirm behavior under php artisan config:cache and in queue workers and Octane-style long-lived processes — connection lifecycle in a long-running worker is a common failure point for producer-per-request designs.

Sequencing. A short, bounded spike before any planning commitment:

  1. Two-day spike (one engineer). Stand up the channel in a throwaway branch against the real cluster, on the real PHP/Laravel versions, with the real auth. Prove: a log line reaches a topic, a partition key is honored, and broker-down behavior is observed and documented.
  2. Decision gate. If the spike requires patching the package, stop and compare against a ~150-line custom Monolog handler wrapping the platform's approved Kafka client. Given the package's size and age, the in-house handler is likely to win on total cost of ownership — and this is a legitimate, defensible outcome that should be presented as such rather than as a failure.
  3. Preferred path if Kafka delivery is genuinely required: in-house handler on the standard client. Preferred path if not: shipper-based routing, no application change.
  4. Only if the spike is clean and the in-house comparison is unfavorable (unlikely) does the package become the chosen implementation, with a named internal owner and a vendored-fork contingency.

Operational Impact

Maintenance. The maintenance burden does not disappear; it transfers. With zero upstream activity, every Laravel or PHP upgrade is a compatibility question we must answer ourselves, and the package sits in the dependency graph as a known-unmaintained node that will be flagged by every SCA/dependency-hygiene check the organization runs. Budget for it as an internally-owned component with an assumed fork-on-first-break posture, and record that owner in the service catalog. The code surface is small enough that forking is realistic — which is also the argument that writing it fresh is realistic.

Support. No vendor, no SLA, no upstream security response. Internal support means whoever wrote the integration. Onboarding documentation must therefore cover the failure modes and the rollback procedure, because the knowledge will not exist in the package's docs or community.

Scaling. Two scaling axes matter. First, log volume: Kafka is a good sink for high-volume, multi-consumer log streams, and this is the package's genuine strength — fan-out to SIEM, archive, and dashboards without duplicating writes. Second, request-path cost: a synchronous producer adds per-log-call latency and a network dependency to every request that logs. At high request rates with verbose logging this is a measurable tax, and it must be buffered or made async, which is precisely the control this package is least likely to expose well. Partitioning and consumer lag become operational concerns owned by the platform team, not the app team.

Failure modes. Enumerate and instrument each before go-live:

  • Broker unreachable / DNS / TLS failure — does the request fail, slow, or proceed? Unbounded blocking here converts a Kafka incident into an application outage. This is the single most important behavior to verify in the spike.
  • Backpressure / buffer exhaustion under a broker slowdown — silent log loss vs. unbounded memory growth.
  • Silent drop on producer error — the worst case for audit logging, since the absence of logs looks identical to the absence of events.
  • Long-lived worker connection staleness in queue workers — reconnect behavior is unverified.
  • Config-cache and multi-tenant edge cases — one channel definition shared across tenants, so partition keys must be derived per-record.
  • No dead-letter path — rejected records have nowhere to go unless we build one.

Mitigation: a fallback stack channel writing to the local/shipper path so a Kafka failure degrades to file-and-ship rather than to nothing, plus an explicit metric/alarm on producer errors and on dropped-record counts. Never let the Kafka channel be the only sink for anything that matters.

Ramp-up. Very low for the happy path — one engineer, under a day, following a config example. The ramp-up cost is entirely in understanding the unhappy paths, and those are undocumented. Realistically: hours to integrate, days to characterize failure behavior with confidence, and an ongoing trickle of maintenance at each framework upgrade. The overall recommendation for a TPM is that the integration itself is trivial and the dependency is the problem — evaluate the shipper-based alternative first, and treat this package as the fallback only if that path is blocked and a short spike proves it clean.

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.
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc
animalyoung/laravel-influxdb
onix-solutions/sms-telera
lonely-lights/prosetta
oxygen/data
oxygen/core
jengo/base
xiloryx/log-collector
a21ns1g4ts/filament-stripe
la-php/laravel-admin
artisan-build/community-prompts
vleroy/smart
ayles-software/laravel-australian-public-holidays
cboxdk/laravel-id-spatie
cboxdk/laravel-id-billing
cboxdk/laravel-id-billing-bridge
simple-as-fuck/php-performance-log