LazyJournal is a terminal user interface (TUI) written in Go, designed for easy analysis of system and application logs. It is inspired by tools like lazydocker and lazygit, providing interactive access to search, view, and filter logs from various sources in the local system.

Why LazyJournal?

Working with logs in the terminal typically requires running various commands, such as journalctl (a utility for reading logs from journald), docker logs, tail, less for viewing, as well as using find to search and grep or other utilities to filter the output. LazyJournal simplifies this process by offering a convenient and intuitive interface that speeds up log analysis. The main advantage is that this tool provides a fast, centralized search for logs across all available sources using keywords.

Today, there are many specialized log management systems, but most of them require configuring a server-side component and installing agents on end machines. These systems can be too heavyweight for monitoring a single system or several microservices, especially when remote log storage is not required. This tool is not a replacement for such systems, rather, it is a simple and fast alternative without dependencies or configuration, primarily useful for low-resource systems, home environments, and for administrators or developers who frequently work with logs.

Key Features

  • Real-time log viewing. Streamed event output is supported, with the ability to filter by keywords (searching for all specified phrases anywhere in the line, case-insensitive, like fzf), as well as support for regular expressions (based on the regexp library).
  • Built-in output coloring. Several color groups are supported for keywords (errors, success, and warnings), as well as UNIX processes, file system paths, URLs, IP addresses, etc.
  • Two-panel interface:
  • * Left panel: Input field for filtering lists and three panels displaying the log lists.
  • * Right panel: Displays the selected log with support for text input for filtering and scrolling through the output.

Each log list window supports switching between additional lists using left and right arrow keys. The log lists are divided into three categories:

  • The first window provides a list of all systemd services (including their current status in the name), system and user logs from journald, as well as a list of all system boots for displaying kernel logs. Additionally, logs from the auditd system in the interpret format are supported, with filtering by keys.
  • The second window shows logs from the file system. The first list (by default) shows all available log files (with a log extension) from the /var/log directory (including archived and truncated logs during rotation) sorted by modification date. Switching to other lists provides logs from the opt directory, all user home directories (home in Linux or Users in macOS), and a list of log files currently being used by processes (file descriptors).
  • The third window supports access to logs from Docker containers, Podman, and Kubernetes pods.

Installation

Since the project is written in Go, it requires no dependencies. To install, simply download the executable file from the releases page. To simplify installation, there is a script that automatically installs the binary and grants execute permissions:

curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.sh | bash

The repository page also includes instructions for installing from popular package managers such as Homebrew, Cargo, and AUR, as well as running it in a Docker container. In addition to Linux, support is available for macOS, FreeBSD, OpenBSD, and Windows for accessing file and container logs. Code for all systems is unit-tested.

Usage

Once installed, you can start the interface from anywhere with the following command:

lazyjournal

lazyjournal -h # to get help

A test log file for an example of output coloring

While running, the utility makes no changes to the system. After launch, you will see the interface, where you can select log sources, filter, and analyze their content.

An example of filtering the output of a container in fuzzy mode

An example of filtering the output of a container in fuzzy mode.

The interface can be controlled using keyboard shortcuts (a full list of shortcuts is available in the help screen by pressing F1), and mouse control is also supported.

Conclusion

The goal of LazyJournal is to provide access to almost any available logs in the local system and simplify the process of searching and analyzing them. If you already use an rsyslog configuration, you will be able to search and view logs from remote systems within a single interface.

The project is actively developed! If you encounter any issues with the utility or have suggestions for improvements, such as adding new log sources or enhancing output coloring, you can open an issue. You can also report compatibility with your operating system (if it differs from the list of tested systems) or upload the package yourself to any package manager you use and open a Pull Request, which will be useful for the development of the project.