A web dashboard for analyzing server log files. Parses logs, handles messy real-world formats gracefully, and presents useful stats — error rates, slowest endpoints, top IPs, request timelines — in a clean browser UI.
- Node.js v18 or higher
- npm (comes with Node.js)
git clone <your-repo-url>
cd log-analyzer
npm installA log generator script is included. Run it before starting the server if you don't have a log file handy:
node scripts/generate-logs.js
# writes 5000 lines → sample.log
node scripts/generate-logs.js 20000 big.log
# custom line count and output pathnode src/server.js --log sample.logThen open your browser at http://localhost:3000
The dashboard loads automatically once the file is parsed. For large files (100k+ lines) this takes a few seconds — the loading screen will show until it's ready.
PORT=8080 node src/server.js --log sample.log| Panel | What it shows |
|---|---|
| Summary bar | Total requests, error count, error rate, avg/p95 response time, skipped lines |
| Requests over time | Line chart bucketed by minute or hour depending on log span |
| Status codes | Doughnut chart — 2xx / 3xx / 4xx / 5xx breakdown |
| HTTP methods | Bar chart — GET / POST / PUT / DELETE counts |
| Slowest endpoints | Top 10 by average response time with p95, max, and error count |
| Top IPs | Top 10 IPs by request volume with per-IP error rates |
| Format anomalies | Every skipped line with its line number and reason |
- ISO 8601 timestamps (
2024-03-15T14:23:01Z) - Slash-format timestamps (
2024/03/15 14:23:01) - Named-month timestamps (
15-Mar-2024 14:23:01) - Unix epoch timestamps (
1710512581) - Response times in ms, seconds, or bare numbers
- Missing or placeholder (
-) status codes - Extra fields (user agents, referrers) appended to lines
- JSON-formatted log lines mixed in
- Indented lines, blank lines, stack traces, and corrupt partial writes
- Files of any size (streamed line by line, never fully loaded into memory)