Lesson 18 — Mini project: log parser
Read the server's diary
Servers write logs: one line per event, usually starting with a level like INFO, WARN or ERROR. A small parser can count lines per level to show if something is wrong. split(" ")[0] takes the first word of a line.
"ERROR db down".split(" ")[0]; // "ERROR"
Why it matters: when the site breaks at night, counting errors in logs is the first thing you do.
Count lines per level into counts, then log INFO, WARN and ERROR counts.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
A quick 3-question quiz on this lesson — instant feedback.
Ready for more? Optional paid resources that pick up where this lesson leaves off.
Some links on this page are affiliate links: we may earn a commission at no extra cost to you. As an Amazon Associate I earn from qualifying purchases.
Project-based Node.js Foundations courses if you want a structured paid path after the free lessons. Wait for a sale — prices drop often.
Browse on Udemy →Search Amazon for Node.js Foundations books — check the publication year so the examples match current versions.
Search Amazon →