novair Back to Novair Logs
Novair LogsLog files

How to open a large log file in VS Code

A log of a few hundred megabytes is enough to make a text editor slow, and a log that is still being written makes it worse. What helps is to read the file as a stream, show the end first and filter instead of scrolling.

Why a big log is hard to open

A text editor is built to edit: it loads the whole file, keeps an undo history and colours every line. For large files VS Code turns some of that off (setting editor.largeFileOptimizations), but the file is still loaded at once, and a file that grows while it is open has to be reloaded.

A log is different: it is read, almost never edited, and what matters is usually at the end. Reading only what is on screen and indexing the rest in the background keeps the window responsive.

Read it as a stream, end first

Novair Logs opens a log read-only and shows the end of the file first. The rest is indexed in the background, in slices: on the largest file we measured (2 GB, on 2026-11-10), the editor never blocked for more than 92 ms, and following kept up with 990 new lines per second.

Once indexed, a filter applies to the whole file and counts what it found, so you do not scroll through millions of lines: type what you are looking for.

{"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"}

Filters that replace scrolling

  • level:error timeout keeps the error entries that contain the word timeout.
  • status:>=500 keeps the 5xx lines of an nginx or Apache access log.
  • order_id:ord_CC46F keeps the JSON entries whose field order_id has that value.
  • -health excludes every line that contains health (the probes of a load balancer, for example).
  • /upstream (timeout|reset)/ is a regular expression.

Filters apply in place, even while the log is followed: no file is saved or created.

On the command line

If you are on the server, the classic tools are fine for a first look: tail -n 200 app.log shows the end, tail -f app.log (or less +F app.log) follows it, grep -n ERROR app.log | tail finds the last errors. They stop being enough when you need to go back and forth, combine conditions or read a JSON entry.

Common mistakes with large logs

  • Opening a rotated log that is still compressed (app.log.1.gz): decompress it first with gunzip -k. Novair Logs says it: “app.log.1.gz is compressed (gzip). Decompress it first, then open the result.”
  • Editing or saving a log that the application is writing: you can lose lines, or the application can keep writing to the old file. Novair Logs never writes to the log.
  • Copying a production log to a ticket as is: it can carry IP addresses, e-mail addresses and tokens. Pro makes an anonymized copy first.
  • Assuming every kind of log opens. Not covered in this version: compressed files (.gz, .zip, .zst: decompress them first); binary logs (journald, Windows Event Log); files on a virtual file system (copy them to a folder on this computer); following the newest file of a folder by pattern; editing log files. Merging: up to 8 logs at a time.

Frequently asked questions

What is the largest log file it can open?

The largest file we measured is 2 GB: the end shows first, the editor never blocked for more than 92 ms. We do not publish a size we have not measured.

Does it change my log file?

No. Novair Logs opens logs read-only; it writes a file only when you save an anonymized copy, where you choose.

How is it different from the most installed log viewer?

The most installed log viewer on the VS Code Marketplace (226,253 installs when we measured on 14 November 2026; last update 22 October 2023) is free, watches files matched by glob patterns and reads many encodings; its README says that for large files it loads only the last 64 KB. If you mainly need to watch a set of files by pattern, it does that and Novair Logs does not. Novair Logs reads the whole file in a stream (tested with a 2 GB file), filters it in place and follows it through rotation and truncation; Pro adds merging, the error timeline and the anonymized copy.

Open your own large logs the same way

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.