π Log Analyzer
A lightweight Node.js utility that logs server activity to a server.log file. It captures incoming HTTP requests, timestamps, and server events β perfect for debugging, monitoring, and learning how logging works under the hood.
π Features
- β Logs every request with timestamp and method
- β
Auto-creates
server.logif it doesn't exist - β Simple, dependency-free implementation
- β Easy to extend with log levels, rotation, or file streaming
π Project Structure
log_analyzer/ βββ app.js # Main server file βββ server.log # Auto-generated log file (ignored in Git) βββ README.md # Project documentation βββ data/ # Optional folder for log storage (auto-created)
`
π οΈ Getting Started
- Clone the repo
git clone
cd log-analyzer
`
2. Run the server
node app.js
Youβll see:
Server started on port 3000
And a `server.log` file will appear with entries like:
[2025-07-30T12:00:00.000Z] GET /
[2025-07-30T12:00:0505.000Z] GET /about
π To-Do (Optional Enhancements)
- [ ] Add log levels (info, warn, error)
- [ ] Implement log rotation
- [ ] Export logs as JSON
- [ ] Add unit tests
π License
MIT β free to use and modify.
πββοΈ Author
*Dimond Madechawo*
https://github.com/dimondkudzai