Features:
* The Filter configuration panel in the TUI now supports
Ā editing the minimum log level and minimum/maximum
Ā times for the current view. Ā Previously, only the
Ā `:set-min-log-level`, `:hide-lines-before`, and
Ā `:hide-lines-after` commands could be used to set the
Ā values. Ā Pressing `l` will create/set the log level.
Ā Pressing `m` will create/set the minimum
Ā time and pressing `Shift` + `M` will create/set the
Ā maximum time. Ā Live preview has also been added to
Ā show which lines will be filtered out when the min/max
Ā is applied.
* The `-S`/`--since` and `-U`/`--until` flags have been
Ā added to limit how much of a log file is indexed.
Ā Supported values are relative (e.g. "yesterday",
Ā "30 min ago") or absolute local times ("2020-01-01").
Ā The values on the main command-line set the defaults
Ā for all values that are opened. Ā The `:open` command
Ā supports the same options to change the values from
Ā the default for a particular file. Ā Files with
Ā content that lie completely outside of the cutoff
Ā will be closed to reduce resource usage.
* Broadened support for viewing files on remote hosts.
Ā The "tailer" program that is transferred to the
Ā remote host to monitor files and perform other tasks
Ā has been translated to Python3. Ā If the remote host
Ā does not have Python, lnav will fall back to the APE
Ā binary.
* Highlights can now be applied to a particular field
Ā instead of the whole line. Ā For log formats, a
Ā `value` entry can now have a `highlights` object
Ā that contains definitions for the pattern to match
Ā and the style to apply. Ā For interactive use, the
Ā `:highlight-field` command was added.
* The "Files" panel now shows a progress bar for each
Ā file as it is being indexed and finishes with a
Ā check-mark if indexing was successful, a warning
Ā sign if the file has some notes, or an error mark
Ā if something else happened.
* The `:write-jsonlines-to` command now supports the LOG
Ā view. Ā When lines are marked in the LOG view, the command
Ā will write each marked log message as a JSON object with
Ā the standard log fields (`log_path`, `log_time`,
Ā `log_level`, `log_opid`, `log_line_link`) along with any
Ā format-specific parsed values, comments, and tags.
Ā The `--all` flag can be used to write all visible log
Ā lines instead of only marked lines.
* Added a log format for MongoDB's structured JSON log
Ā format (4.4+).
* Added a log format for the Robot Framework's debug
Ā log file format.
* Added `"timestamp"` as a value kind for log format
Ā definitions. Ā Fields with this kind will be parsed
Ā and displayed in the local timezone, and SQL
Ā queries will return them in a normalized format.
* Added the `:toggle-sticky-header` command to pin a
Ā line to the top of the view as a sticky header.
Ā Sticky headers remain visible as you scroll past
Ā them, making it easy to keep context lines in view.
Ā The `:clear-all-sticky-headers` command removes all
Ā sticky headers in the current view. Ā A hidden
Ā `log_sticky_mark` column is available in log tables
Ā to get/set the sticky state via SQL. Ā Sticky headers
Ā and user bookmarks are saved and restored across
Ā sessions for both log and text views. Ā The command
Ā is bound to `CTRL+S` by default.
* In pager mode (activated by the `-q` flag), the input
Ā will always be written to the terminal if it is
Ā smaller than the height. Ā Previously, if the input
Ā took awhile to generate, nothing would be written.
Ā Also, when the input is larger than the terminal
Ā height, any marked lines will be written to the
Ā terminal.
* Introducing "Log-Oriented Debugging", a collection of
Ā features to streamline mapping log messages back to
Ā the source code that generated them. Ā For example,
Ā given the log message "Hello, Steve!" and the source
Ā directory containing the log statement. Ā lnav can
Ā find the line of code that generated the message,
Ā determine the value of the substituted variables
Ā (`name` => `Steve`). This functionality is
Ā implemented using the
Ā The following features have been added in support of
Ā this functionality:
Ā - The `:add-source-path` command was added to specify
Ā Ā the source directories to be scanned for log
Ā Ā statements.
Ā - Log formats can now specify source file/line and
Ā Ā thread ID with the `src-file-field`, `src-line-field`,
Ā Ā `src-location-field`, and `thread-id-field` properties.
Ā Ā These fields can then be accessed in the SQL vtables
Ā Ā as `log_src_file`, `log_src_line`, and `log_thread_id`.
Ā - The `:breakpoint`, `:toggle-breakpoint`, and
Ā Ā `:clear-breakpoints` commands have been added to
Ā Ā support setting/clearing breakpoints for log messages.
Ā Ā The `CTRL-B` shortcut toggles a breakpoint on the
Ā Ā focused line in the LOG view. Ā Once breakpoints have
Ā Ā been added, you can press `F7`/`F8` to move to the
Ā Ā previous/next log message that matches a breakpoint.
Ā - The `:disable-breakpoint` and `:enable-breakpoint`
Ā Ā commands have been added to allow disabling a
Ā Ā breakpoint without deleting it.
Ā - If the log format specifies source file/line fields
Ā Ā and a breakpoint is set, a red bullet point will be
Ā Ā inserted to signify the presence of a breakpoint.
Ā Ā Left-clicking on the bullet will toggle enabling/
Ā Ā disabling the breakpoint. Ā A right-click will
Ā Ā delete the breakpoint.
Ā Ā In addition, if the `:add-source-path` command has
Ā Ā been used, the first character of the source file
Ā Ā will be underlined and can be left-clicked to open
Ā Ā the source file at the given log message. Ā A
Ā Ā right-click will set a breakpoint.
* The `all_opids` and `all_thread_ids` virtual tables
Ā have been added to make it simple to discover all of
Ā the operations and threads across all log files. Ā The
Ā `all_opids` table also supports setting a description
Ā for an operation using through an `UPDATE`.
* The `:xopen` command will now open text files in an
Ā external editor. Ā To open the file at a particular
Ā line/column, add a URL fragment of the form
Ā `L<line>C<column>`.
* When opening the contents of the prompt in an external
Ā editor (`CTRL+O`), the cursor position will be preserved,
Ā if possible.
* The `external-editor` configuration has been expanded
Ā with extra properties to help lnav choose the right one
Ā to use:
Ā - The `config-dir` property specifies the name of the
Ā Ā directory that stores the editor's configuration in a
Ā Ā source tree. Ā If the directory is found in an ancestor
Ā Ā of the path to be opened, and it has the most recent
Ā Ā modified time, the associated editor will be used.
Ā - The `prefers` property is a regular expression that
Ā Ā will be tested against the full path to be opened.
Ā Ā If matched, that editor will be chosen.
* The `:external-access` command has been added to open a
Ā localhost HTTP port that can be used to remotely control
Ā lnav. Requests can be sent to execute commands and poll
Ā for changes in the view state. Ā When the external port
Ā is open, a globe icon (š) is displayed in the top-right
Ā corner. Ā Clicking that icon will open a URL in a browser
Ā and log you into the server. Ā The `:external-access-login`
Ā command can also be used to login.
* Custom "Apps" can be added to the "external access"
Ā server to provide custom browser-based user interfaces
Ā to lnav. Ā See the "External Access" documentation online
Ā for more details.
* The `;.save` SQL command has been added that can save
Ā tables you have created to a SQLite database file. Ā The
Ā tables that lnav creates have been moved to a separate
Ā in-memory DB, so the main DB should only contain your
Ā own tables/views/etc...
* The `json_object_count_of()` SQL aggregate function has
Ā been added to make it easy to create a JSON object
Ā where the values are the number of times a value has
Ā been seen.
* The `:write-json-cols-to` command has been added to
Ā write JSON output in a column-oriented fashion.
* The `encode()` and `decode()` SQL functions now accept
Ā `html` as an algorithm.
* The `opid-field` can now be set to a JSON array/object
Ā for JSON-lines logs. Ā For example, the `spans` array in
Ā a Rust tracing log message. Ā The OPID for the message
Ā will be computed by hashing the contents of the array
Ā or object and the description will be the container
Ā itself.
* An OPID can now be constructed from multiple fields by
Ā leaving the `opid-field` blank and creating a single
Ā `opid/description` definition with a format. Ā The
Ā content of the format fields will then be hashed to
Ā create the OPID. Ā The builtin log formats have been
Ā updated to use this when appropriate. Ā For example,
Ā access_log now uses `c_ip` and `cs_user_agent` as the
Ā OPID.
Ā > [!NOTE]
Ā > If you want a description, but don't want it used as
Ā > the OPID. Ā You can set the `opid/source` field to
Ā > "from-whole-msg" and the OPID will be computed from
Ā > the contents of the log message.
* The `duration-field` log format property has been added
Ā to specify the field that contains a duration in the
Ā log message. Ā If a duration is available, it will be
Ā used to calculate time spans in the TIMELINE view.
Ā If the value of field is a number that is not in
Ā seconds, the `duration-divisor` property can be used
Ā to convert it. Ā For example, if the duration field is
Ā in milliseconds, the divisor should be 1000. Ā The
Ā duration can be accessed in the SQL vtables through
Ā the `log_duration` column. Ā For JSON-lines logs, the
Ā special `__duration__` field name can be used in the
Ā `line-format` to add a humanized version of the
Ā duration to the pretty-printed message.
* The TIMELINE view now shows rows for user-defined tags
Ā and partitions. Ā Each tagged log line appears as a
Ā separate entry in the timeline. Ā Tags whose names start
Ā or end with "start", "started", or "begin"
Ā (case-insensitive) will have their time range extended
Ā to the next instance of the same tag, with the last
Ā instance extending to the end of the log. Ā Partition
Ā rows span from their start time to the next partition
Ā (or end of log).
* Added `:hide-in-timeline` and `:show-in-timeline`
Ā commands to control which row types (logfile, thread,
Ā opid, tag, partition) are visible in the timeline view.
Ā The `:hide-in-timeline` command supports live preview,
Ā highlighting rows that would be hidden in red.
* The `timestamp-point-of-reference` log format property
Ā has been added to specify the relation of the timestamp
Ā to the operation that the message refers to, either:
Ā `start` or `end`. Ā This is used in conjunction with the
Ā message duration to determine the time span.
* The OPID for log messages is now shown in the parser
Ā details overlay (revealed by pressing `p`) in the
Ā LOG view.
* Added `rust_tracing_log` format from @richard-hajek.
* Added `macosuni_log` format that understands the
Ā output of the macOS `log stream --style=ndjson`
Ā command.
* Added the `idea_log` format from @segevfiner.
* The `strace_log` format has been improved to handle
Ā more output formats and the syscalls will now show
Ā up in the TIMELINE view.
* The `strace://` URL-handler has been added to make it
Ā easier to run `strace` on an existing process. Ā A
Ā host must be given and the path should be the PID,
Ā such as `strace://localhost/1234`.
* Added the `nestable` flag to the log format and
Ā theme highlight configurations to control whether a
Ā highlight can be applied to text that is covered by
Ā another highlight.
* Search tables are now included in the output of
Ā the `:export-session-to` command.
Breaking changes:
* All of lnav's SQLite tables have been moved to a
Ā separate in-memory database that is attached as
Ā `lnav_db`. Ā You may need to update some of your SQL
Ā statements to qualify table names with `lnav_db.`.
Ā This change was made so that the main DB only contains
Ā user data that can be easily backed up to a new DB
Ā file.
* Timestamp columns and results from lnav time functions
Ā now have microsecond precision instead of millisecond.
* The "module format" functionality has been removed.
Ā This functionality tried to match log messages wrapped
Ā in another format (usually syslog), but it never
Ā really worked well and was impeding progress in other
Ā areas. Ā Also, there have been many features added
Ā since the beginning that can serve the same use cases.
* The `sudo_log` format has been removed since it was
Ā a module-only format. Ā Instead, a `sudo_log`
Ā search-table was added to the `syslog_log` format.
Interface changes:
* Mouse mode is now enabled by default.
* The `CTRL+f` hotkey has been remapped to the
Ā `:toggle-filtering` command.
* Aborting the prompt now requires two successive
Ā presses of `Esc` (a message will pop up on the right
Ā that mentions this). Ā Since `Esc` is also used to
Ā close the completion popup, it was too easy to
Ā cancel the prompt. Ā Pressing `CTRL+]` will still
Ā close the prompt immediately.
* The TIMELINE view has a few updates:
Ā - The header has been redesigned to be one line that
Ā Ā shows the time increments at the current scale.
Ā Ā This approach should more clearly convey the spans
Ā Ā of time shown in the main part of the view. Ā The
Ā Ā previous design tried to show the overall time and
Ā Ā the current time frame. Ā But, the multi-line header
Ā Ā was hard to interpret and didn't make it clear how
Ā Ā large the time increments were.
Ā - Log files and threads are now shown in the view
Ā Ā in addition to operations.
* The HIST view now shows the year and inserts a spacer
Ā row in-between gaps in time. Ā The spacer row shows
Ā bullet points on a log scale to represent the amount
Ā of time in the gap.
* The SPECTRO view now shows the year in timestamps
Ā and uses additional colors to show the value range.
* The breadcrumb bar in the LOG view now includes the
Ā current thread, if defined.
* If there are background tasks, like the processing done
Ā by `:add-source-path`, a panel with progress bars for
Ā each operation will be shown just above the bottom
Ā status bar.
* The first line of a multi-line log message will now be
Ā shown in the header of the LOG view if the message has
Ā scrolled off the screen. Ā When scrolled to the
Ā beginning of the content, the top line will indicate
Ā if any log messages were filtered out before the first
Ā message. Ā Left-clicking on the header will scroll the
Ā view to the displayed line.
* In the Filters configuration panel, you can now
Ā create/edit the SQL expression filter by pressing the
Ā `e` key.
* The `{` hotkey and `:prev-section` command will now
Ā move to the first line of a multi-line log message if
Ā the focused line is in the middle of the message.
* The `}` hotkey and `:next-section` command will now
Ā move to the next log message if the focused line is
Ā in the middle of a multi-line message.
* The parser-details overlay now mentions any search
Ā tables that match the focused line. Ā Now, you don't
Ā have to remember the names of the tables.
* If a text file contains invalid UTF-8 content, the
Ā invalid bytes will be shown as the replacement
Ā character (ļæ½) and, when the line is focused, an
Ā overlay will show a hex dump of the line.
Performance:
* Searches now run in parallel using multiple child
Ā processes. Ā Large line ranges are split into chunks
Ā and distributed across available CPU cores, speeding
Ā up search in large files.
Bug Fixes:
* If a file path contains a hash (`#`), check if the path
Ā exists before splitting around the hash and treating it
Ā as an internal file location.
* The initialization sequence has been cleaned up to
Ā hopefully make it more consistent/reliable. Ā This
Ā concerns the sequence of loading files and executing
Ā commands from the command-line.
* In the SPECTRO view, you can now move to the next/
Ā previous row with bookmarks. Ā Note that this view
Ā synchronizes bookmarks with the LOG view.
* Session state should no longer override commands
Ā passed on the command-line.
* Marks in the TEXT view are now stable after filtering
Ā is applied.
* Error bookmarks are now added for stderr content when
Ā executing a command in the shell using `-e` or `:sh`.
Internal:
* Added operation IDs (OpIDs) to lnav's internal logging
Ā to make it easier to identify the high-level operations
Ā that are being performed using the TIMELINE view.
Ā While this is mainly useful to the authors of lnav, it
Ā can serve as a good example of the benefits of adding
Ā OpIDs and the TIMELINE view.
Thanks,
Tim Stack