twilight ventures

reading a multi-gigabyte log in place

A production log is the longest tunnel we know. It grows a line at a time for as long as the process ran, and by the time someone needs it there is more of it than any editor wants to load. The way through is an index of where every line starts, taken once, after which the errors can be brought into view on their own, whether the log sits on disk in the IDE or on the Jira issue that reported it.

Two products read a log this way. Log Lens opens a multi-gigabyte log inside IntelliJ IDEA and the other JetBrains IDEs, beside the text editor and without touching it. Lens File Viewer for Jira opens a log attached to an issue on the issue itself, fetched in byte ranges under the permissions of the person viewing it. The file is never held in memory, and it is never written to.

in a jetbrains ide

Install Log Lens from the JetBrains Marketplace and open the file from the project tree. What follows in this section is the free tier. The Log Lens tab opens at once with the first screen of lines already there, while the index of byte offsets fills in behind it, and what stays in memory is that index, not the text. The status line reads Page 1 / 30 with the file size beside it. When the level scan finishes, the chips over the log turn from blank to whole-file counts of ERROR, WARN, INFO, DEBUG and TRACE, and a chip narrows the view to its level. Find in file searches every line with a match count and a next and previous jump, and a stack-trace line links into your project. The format is recognized on open, plain text, JSON lines or logfmt; ANSI escape codes render as colors; an EUC-KR, Shift_JIS, Windows-1250, ISO-8859-2 or CP852 log opens with its letters intact; and follow mode tails the file as it grows, through a rotation.

Pro is a subscription with a 30-day trial, and the product page quotes the price. It adds a filter query over level, field, time and text, scanned across the whole file so that only the matching lines are left to browse, and a filtered follow that tails those lines live. Log statistics draw a per-level histogram over time with the span and the rate, so the minute the errors clustered shows on the chart. Export writes the current page, the filtered view, the search matches or the query matches to a new .log, JSONL, CSV or Parquet file; in Parquet each parsed field is a typed column and the original line is kept in a column of its own.

Log Lens in IntelliJ IDEA: level chips with counts above a paged log and a detail pane
gateway.log in a JetBrains IDE: the level chips carry whole-file counts, ERROR 147 and WARN 268 among them, over page 1 of 30, with the selected line in the detail pane.

compressed and rotated logs

A .log.gz is decompressed to a temporary file before it can be read, and the note under the file says how much temp space that will take (at least that much, when the gzip container can only prove a floor). If the temp directory cannot hold it, the open is refused at once with both sizes in the message, instead of after minutes of work. app.log opens beside app.log.1 and app.log.2 when they sit together. A .txt or .out file stays with the text editor.

on a jira issue

On a Jira issue, Lens File Viewer for Jira is a panel: press the app actions button under the issue title, choose Lens File Viewer, and the panel lists the issue's data files; when exactly one is a format it knows, it opens directly. A log is line indexed on the way in, and the level scan reads the whole attachment in byte ranges under your own Jira permissions, so someone who cannot download the attachment cannot read it here either. When the scan finishes the chips carry the counts; one click narrows the view to a level, a second click drops it, and with two chips on the status reads ERROR + WARN only. The arrow beside ERROR jumps to the next ERROR line, Go to row takes a file line number, search scans the whole file with a hit count, and the continuation lines of a stack trace stay with their first line. The 38 MB log in the screenshot on the product page opened in about three seconds.

A gzip-wrapped .log.gz inflates in the browser under a 384 MB decompressed ceiling, and a larger one asks for a download instead. Export CSV writes the log out as level, timestamp and message columns. The app is free for sites up to ten users and past ten every user is billed at the rate the product page quotes.

where it stops

Neither reader changes a log. Log Lens opens local files only, so there is no ssh tailing and no line of the log is sent anywhere, and its filtered follow shows the matching lines as they arrive without notifying anyone. Both readers take text logs, whether plain, JSON lines or logfmt, and a binary format is not parsed.