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

Log Parser Laravel Package

kassner/log-parser

kassner/log-parser turns Laravel, Apache, Nginx, and other log files into structured data. Define patterns, stream large files line by line, and extract dates, levels, messages, and context for analysis, reporting, or dashboards. Fast and memory-efficient in any PHP or Laravel app.

Deep Wiki
Context7

Product Decisions This Supports

  • Unlocking existing data before buying analytics: Every request your app serves already produces a record in web server logs. This package turns those raw lines into structured records (IP, timestamp, method, path, status, response size, referer, user-agent), so you can ship first-party traffic reporting without a new vendor, tag manager, or client-side instrumentation.
  • Build vs. buy for internal reporting: Supports a "build" decision for lightweight dashboards — traffic volume, top pages, error-rate trends, referrer mix, bot vs. human ratio — when a full observability platform (Datadog, New Relic, ELK) is over-scoped for the question being asked.
  • Roadmap prioritization from real usage: Enables feature-usage and funnel analysis from access logs (e.g., which endpoints are actually hit, abandonment signals in 4xx/5xx patterns) to validate assumptions before committing roadmap capacity.
  • Security and abuse triage: Structured parsing makes it cheap to surface brute-force patterns, scraping signatures, and anomalous status-code spikes — useful for deciding whether to invest in WAF, rate limiting, or nothing at all.
  • Compliance and audit groundwork: Provides a defensible, reproducible way to extract access records for retention policies, incident post-mortems, and internal audit requests without adding a logging SaaS contract.
  • Cost-of-ownership comparison: A PHP-native, Apache-2.0 library with no runtime infrastructure lets you quantify "what would this cost us in engineering days vs. per-GB vendor pricing?" — a concrete input to procurement decisions.
  • Internal tooling scope: Fits decisions about embedding log-derived views into an existing Laravel admin panel rather than standing up a separate BI pipeline.

When to Consider This Package

Consider adoption when:

  • Your stack is PHP/Laravel and you want log analysis to live inside the app you already operate, not beside it.
  • Volume is modest — thousands to low millions of lines per reporting window, processed in batch/cron. PHP parsing is single-process and memory-bound; it is not a streaming engine.
  • You need structured extraction from standard Apache/Nginx formats, including custom LogFormat regexes and gzipped rotation files.
  • The output is periodic reporting or backfill analysis, not sub-second alerting.
  • You want no new infrastructure — no Elasticsearch cluster, no agent rollout, no vendor onboarding.
  • You need a stable, narrow dependency: small surface area, permissive license, mature codebase, easy to vendor or replace.

Look elsewhere when:

  • Throughput is high or real-time — use a log aggregator or columnar store (ELK/OpenSearch, ClickHouse, Loki, Splunk). Parsing millions of lines per minute in PHP is the wrong tool.
  • You need alerting, correlation, or distributed tracing — that is an observability platform's job, not a parser's.
  • You need application-level events (clicks, form completions, business metrics). Server logs are a lossy proxy; instrument the app or adopt product analytics instead.
  • Your non-PHP services dominate — you would be maintaining a polyglot analysis path for one language's worth of convenience.
  • You require vendor SLAs or active maintenance guarantees — the last tagged release is 2023 and the project is community-maintained; treat it as "stable but quiet" and plan for the possibility of owning forks or patches.
  • Log formats are unstable or frequently custom — heavy format churn favors schema-at-source (structured JSON logging via Monolog) over post-hoc regex parsing.

How to Pitch It (Stakeholders)

For executives — one paragraph: We already pay to generate web server logs on every request; today we largely throw that data away. This is a small, free, permissively licensed PHP library that converts those logs into structured records, letting us answer routine questions — traffic trends, error spikes, top content, suspicious activity — from inside our existing application. The business case is avoided cost and faster answers: it defers a five-to-six-figure observability or analytics contract while we validate whether we actually need one, and it lets a single engineer ship a working internal report in days rather than a quarter. Risk is low: it is a narrow, replaceable dependency with no infrastructure footprint and no lock-in. It is explicitly not a replacement for real-time monitoring or product analytics at scale — it is the cheap, high-leverage first step, and it will tell us clearly when we have outgrown it.

For engineering — the summary: A focused parser for Apache/Nginx access logs with custom LogFormat support and gzip handling, integrating cleanly into a Laravel service provider or a scheduled command. It returns typed objects per line rather than arrays, which keeps the aggregation layer readable. Caveats to plan around: it is single-threaded and memory-bound, so design around chunked/streamed reads and cap the reporting window; the project is stable but has not been released since mid-2023, so pin the version and be prepared to vendor it if we need a fix. Recommended first slice: a nightly job that parses the previous day's rotated logs into a summary table, surfaced in the existing admin panel — small blast radius, immediate signal, and a clear measurement of whether we need to escalate to a proper log platform.

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.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route