JSON log viewer: how to read and filter a JSON lines log
Structured loggers (pino, bunyan, zap, slog, structlog, Serilog with a JSON formatter) write one JSON object per line. It is easy for a machine and hard for a person: here is how to read it, field by field.
One JSON object per line
A JSON lines log (also called NDJSON, files .jsonl or .ndjson, often just .log) has one complete JSON object per line. Three lines of the API log from our sample incident:
{"time":"2026-11-09T13:04:57.473Z","level":"error","logger":"PaymentClient","msg":"Payment authorization failed: upstream timeout after 3000 ms","provider":"stripe","attempt":1,"order_id":"ord_CC46F","client_ip":"10.20.6.31","customer":{"email":"lea.martin@shop.test"},"trace_id":"05370bb73c6ceb46fd166f168d1fb61d"}
{"time":"2026-11-09T13:04:57.478Z","level":"warn","logger":"CheckoutService","msg":"Retrying order in 500 ms","order_id":"ord_CC46F","order_retry":1,"trace_id":"05370bb73c6ceb46fd166f168d1fb61d"}
{"time":"2026-11-09T13:04:57.978Z","level":"debug","logger":"PaymentClient","msg":"Calling payment provider","provider":"stripe","attempt":2,"order_id":"ord_CC46F","trace_id":"05370bb73c6ceb46fd166f168d1fb61d"}Level, time and message
Novair Logs looks for the level in the fields level, lvl, severity, log.level or levelname, for the time in time, timestamp, ts, @timestamp, date or t, and for the message in msg or message. The first one found wins.
Levels can be words (trace, debug, info, warn or warning, error, fatal, and their usual variants such as SEVERE or CRITICAL) or the numbers of pino and bunyan: 10 trace, 20 debug, 30 info, 40 warn, 50 error, 60 fatal.
Every other field stays available: open an entry and it is shown as a tree, and any value can become a filter.
Filter on a field
- order_id:ord_CC46F keeps the entries of one order.
- customer.email:lea.martin@shop.test reads a nested field (sample address).
- attempt:>=2 compares numbers: only the retries.
- level:error timeout mixes a level and a word of the line.
- -logger:CheckoutController excludes one logger.
Spaces mean AND, a leading minus excludes, quotes keep a phrase together. The same key:value syntax works on logfmt lines (level=error msg=…) and on web access logs (status:>=500).
Common pitfalls
- Pretty-printed JSON (one object over several lines) is not JSON lines: each line is then shown as text. Configure the logger to write one object per line.
- A level written as a number is not an error by itself: 50 is error in pino and bunyan, but another logger may use other numbers.
- Times without a zone are read as local time; times ending in Z or +01:00 keep their zone. Mixing both matters when you merge logs.
- A filter with a broken regular expression is refused and the last valid filter stays applied: “Invalid regular expression: an escape such as \q is not valid here.”
Frequently asked questions
Can I view a JSON log online?
Yes, up to 20 MB, in the free log viewer online of this site: the file is read in your browser and never sent. For larger files and live tail, use Novair Logs in VS Code.
Does it open .jsonl and .ndjson files?
Yes. Novair Logs offers itself for .log, .jsonl, .ndjson, .out and .err files, and any other file opens with Reopen Editor With… › Novair Logs.
Read your JSON logs this way in VS Code
Novair Logs for VS Code opens large logs as a stream, follows them live without flicker and filters them by level, regular expression or JSON field, on your machine. Free, no account; Pro merges several logs by time and writes an anonymized copy.