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.
Consider adoption when:
LogFormat regexes and gzipped rotation files.Look elsewhere when:
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.
How can I help you explore Laravel packages today?