A TUI and Web mode for reading logs from journalctl, file system, Docker, Podman and Kubernetes.
10K+
Terminal user interface for viewing logs from journald, auditd, file system, Docker and Podman containers, Compose stacks and Kubernetes pods with supports log highlighting and several filtering modes. Written in Go with the awesome-gocui (fork gocui) library.
This tool is inspired by and with love for LazyDocker and LazyGit. It is also included in Awesome-Go, Awesome-TUIs and Awesome-Docker, check out other useful projects on the repository pages.
Note
You can try it out on the [Killercoda](https://killercoda.com/lazyjournal/scenario/playground) playground.

tail).systemd to access their logs.journalctl (tool for reading logs from journald).auditd for filtering by keys and viewing in interpret format.Apache or Nginx, as well as syslog, messages, etc. from /var/log.gz, xz and bz2 formats) and Packet Capture (pcap format).asl format).PowerShell and wevtutil, as well as application logs from Windows file system.kubeconfig).ssh protocol.Supports 4 filtering modes:
fzf) - custom inexact case-insensitive search (searches for all phrases separated by a space anywhere on a line).grep) - search with regular expression support, based on the built-in regexp library, case-insensitive by default (in case a regular expression syntax error occurs, the input field will be highlighted in red).since and/or until) for journald logs, as well as Docker or Podman containers (only supported in streaming mode) using the left and right arrow keys. This mode affects log loading (this is especially relevant for large logs, thereby increasing performance) and can be used in combination with other filtering modes.Several log output coloring modes are supported:
When using external tools, they are required to be already installed on your system. You can also disable output highlighting with the Ctrl+Q keyboard shortcut, this is useful for improving performance when viewing large logs or if your terminal already has a built-in highlighting feature, such as WindTerm.
The built-in highlighting by default supports several color groups:
A full list of all keywords can be found in the color.log file (used for testing only).
Important
If you have suggestions for improving log highlighting (e.g. adding new keywords), you can open an [issue](https://github.com/Lifailon/lazyjournal/issues) for a new feature.
Binaries are available for download on the GitHub releases page.
Run the command in the console to quickly install or update the stable version for Linux, macOS or the BSD-based system:
curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.sh | bash
This command will run a script that will download the latest binary (auto-detect OS and arch) from the GitHub repository to your home directory along with other executables (default path is ~/.local/bin/lazyjournal) and configurations (~/.config/lazyjournal/config.yml) for the current user, and also grant execute permission.
To install and remove packages on an Ubuntu system, you can use the apt package manager from the PPA repository:
sudo add-apt-repository -y ppa:lifailon/lazyjournal
sudo apt update
sudo apt install -y lazyjournal
Or download the deb package from the GitHub releases page for installation on any Debian-based system.
curl -sSL https://github.com/Lifailon/lazyjournal/releases/download/0.8.4/lazyjournal-0.8.4-$(dpkg --print-architecture).deb -o /tmp/lazyjournal.deb
sudo apt install -y /tmp/lazyjournal.deb && rm /tmp/lazyjournal.deb
Use the following command to install lazyjournal using Homebrew:
brew install lazyjournal
If you use package managers like conda or mamba, you can install lazyjournal from conda-forge:
conda install -c conda-forge lazyjournal
mamba install -c conda-forge lazyjournal
You can install lazyjournal user-globally using pixi:
pixi global install lazyjournal
If you an Arch Linux user you can also install from the AUR:
paru -S lazyjournal
Download the docker-compose file and run the container using the image from Docker Hub:
mkdir lazyjournal && cd lazyjournal
curl -sS https://raw.githubusercontent.com/Lifailon/lazyjournal/refs/heads/main/docker-compose.yml -o docker-compose.yml
docker compose up -d
docker exec -it lazyjournal lazyjournal
The image is based on Debian with systemd, docker cli, docker-compose and kubectl pre-installed. The necessary permissions are already pre-set in the file to support all log sources from the host system.
To access Kubernetes logs, you need to forward the configuration to the container. If you're using a local cluster (e.g., k3s), change the cluster server address in the configuration to the host address on the local network.
Supports running in a container with a Web interface, using ttyd to access logs via a browser. To do this, edit the variables:
# Enable Web mode
TTYD=true
PORT=5555
# Credentials for accessing via Web browser (optional)
USERNAME=admin
PASSWORD=admin
# Flags used (optional)
OPTIONS=-t 5000 -u 2
Use the following command to quickly install in your PowerShell console:
irm https://raw.githubusercontent.com/Lifailon/lazyjournal/main/install.ps1 | iex
The following directories are used to search for logs in the file system:
Program FilesProgram Files (x86)ProgramDataAppData\Local and AppData\Roamin for current userTo read logs, automatic detection of the following encodings is supported:
UTF-8UTF-16 with BOMUTF-16 without BOMWindows-1251 by defaultYou can install it as a package using Go (this will install the version from the latest commit, which may be unstable):
go install github.com/Lifailon/lazyjournal@latest
You can start the interface from anywhere: lazyjournal or use lazyjournal -h for help on available flags.
The application is an interface for viewing logs with the ability to filter them for analysis. Therefore, to access the logs themselves, it is necessary that such programs as docker-cli, compose, podman and kubectl are already installed on your system.
Access to all system logs and containers may require elevated privileges for the current user. For example, if a user does not have read permission to the directory /var/lib/docker/containers, he will not be able to access all archived logs from the moment the container is started, but only from the moment the containerization system is started, so the process of reading logs is different. However, reading in streaming mode is faster than parsing json logs from the file system.
Hotkeys and settings values can be overridden using the config file (see issue #23 and #27), which can be in ~/.config/lazyjournal/config.yml, as well as next to the executable or in the current startup directory (has high priority).
Mouse control is supported (but can also be disabled with the -m flag or configuration) for selecting window and the log from list, as well as lists and log scrolling. To copy text, use the Alt+Shift key combination while selecting.
Supports access to logs on a remote system using standard ssh arguments to configure the connection (passed as a single quoted parameter).
lazyjournal --ssh "[email protected]"
# Passing arguments
lazyjournal --ssh "[email protected] -p 2121 -o Compression=yes"
# If sudo is supported without entering a password
lazyjournal --ssh "[email protected] sudo"
You can also pass a list of hosts to the lazyjournal configuration and switch between them in the interface (use the F2 key to invoke ssh manager):
ssh:
hosts:
- [email protected]
- [email protected] -p 2121 -o Compression=yes
- [email protected] -o StrictHostKeyChecking=no -o ConnectTimeout=5
Remote access is only possible using an ssh key (since each function call requires a password). However, password-based access is possible by configuring password storage for a long period of time in the ~/.ssh/config file:
Host *
# Keep the connection open for 1 hour
ControlMaster auto
ControlPath ~/.ssh/%r@%h:%p
ControlPersist 1h
# Avoid errors when checking the key of a host you have not connected to before
StrictHostKeyChecking no
Output highlighting and filtering are supported in command line mode:
# Add an alias to your shell profile
alias lj=lazyjournal >> $HOME/.bashrc
# Highlight output from standard input
cat /var/log/syslog | lj -c
# Filtering in fuzzy search
cat /var/log/syslog | lj -f "error"
# Filtering using regular expressions
cat /var/log/syslog | lj -r "error|fatal|fail|crash"
# Filtering with subsequent highlighting of the output
cat /var/log/syslog | lj -r "error|fatal|fail|crash" -c
Clone the repository and use Make to build the binary:
git clone https://github.com/Lifailon/lazyjournal
cd lazyjournal
make build
Note
The repository uses AI-powered release analysis in the [changelog](/changelog.md) file and the commit review with sending reports to [Telegram channel](https://t.me/lazyjournal_actions).
Unit tests cover all main functions and interface operation.
# Get a list of all tests
make test-list
# Run selected or all tests
make test-run n=TestMockInterface
make test-all
Note
Build and testing is automated using CI Actions. A detailed test coverage report for Linux, macOS and Windows systems is available on the [Wiki](https://github.com/Lifailon/lazyjournal/wiki) page.
Since this is my first Go project, there may be some bad practices, BUT I want to make lazyjournal better. Any contribution will be appreciated! If you want to implement any new feature or fix something, please open an issue first.
Thanks to all participants for their contributions:
AUR.Homebrew and Conda.You can also upload the package yourself to any package manager you use and make Pull Requests.
This project is licensed under the MIT License. See the LICENSE file for details.
Copyright (C) 2024 Lifailon (Alex Kup)
Content type
Image
Digest
sha256:14ed317d3…
Size
111.8 MB
Last updated
7 months ago
docker pull lifailon/lazyjournal