You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Terminal user interface for reading logs from `journalctl`, file system, Docker and Podman containers, as well Kubernetes pods for quick viewing and filtering with fuzzy find (like `fzf`), regex support (like `grep`) and coloring the output, written in Go with the [awesome-gocui](https://github.com/awesome-gocui/gocui) (fork [gocui](https://github.com/jroimartin/gocui)) library.
19
+
Terminal user interface for reading logs from `journalctl`, file system, Docker and Podman containers, as well Kubernetes pods for quick viewing and filtering with fuzzy find, regex support and coloring the output, written in Go with the [awesome-gocui](https://github.com/awesome-gocui/gocui) (fork [gocui](https://github.com/jroimartin/gocui)) library.
18
20
19
-
This tool is inspired by and with love for [LazyDocker](https://github.com/jesseduffield/lazydocker) and [LazyGit](https://github.com/jesseduffield/lazygit), as well as is included in [Awesome-TUIs](https://github.com/rothgar/awesome-tuis?tab=readme-ov-file#development) and [Awesome-Docker](https://github.com/veggiemonk/awesome-docker?tab=readme-ov-file#terminal-ui), check out other useful projects on the repository pages.
21
+
This tool is inspired by and with love for [LazyDocker](https://github.com/jesseduffield/lazydocker) and [LazyGit](https://github.com/jesseduffield/lazygit). It is also included in[Awesome-Go](https://github.com/avelino/awesome-go?tab=readme-ov-file#logging),[Awesome-TUIs](https://github.com/rothgar/awesome-tuis?tab=readme-ov-file#development) and [Awesome-Docker](https://github.com/veggiemonk/awesome-docker?tab=readme-ov-file#terminal-ui), check out other useful projects on the repository pages.
20
22
21
23

22
24
23
-
## Functional
25
+
## Features
24
26
25
27
- Simple installation, to run download one executable file without dependencies and settings.
26
-
- Displays the current log output in real-time (updated every 5 seconds, file logs are updated only when there are changes).
27
-
- List of all units (`services`, `sockets`, etc.) via `systemctl` with current running status.
28
-
- View all system and user journals via `journalctl` (tool for reading logs from [systemd-journald](https://github.com/systemd/systemd/tree/main/src/journal)).
28
+
- Centralized search for the required journal by filtering all lists (log sources).
29
+
- Streaming output of new events from the selected journal (like `tail`).
30
+
- List of all units (`services`, `sockets`, etc.) with current running status from `systemd` via `systemctl`.
31
+
- View all system and user journals via `journalctl` (tool for reading logs from [journald](https://github.com/systemd/systemd/tree/main/src/journal)).
29
32
- List of all system boots for kernel log output.
30
-
- File system logs (example, for `Apache` or `Nginx`), as well as `syslog` or `messages`, `dmesg` for kernel logs, etc.
31
-
-List of all log files of descriptors used by processes, as well as all log files in the home directories of users.
32
-
- Reading archived logs (`gz`, `xz`or`bz2`format), packet capture (`pcap` format) and Apple System Log (`asl` format).
33
+
- File system logs such as for `Apache` or `Nginx`, as well as `syslog`, `messages`, etc. from `/var/log`.
34
+
-Lists all log files in users home directories, as well as descriptor log files used by processes.
35
+
- Reading archive logs truncated during rotation (`gz`, `xz`and`bz2`formats), Packet Capture (`pcap` format) and Apple System Log (`asl` format).
33
36
- Docker containers (including `timestamp` and `stderr`), Podman pods and the Docker Swarm services.
34
-
- Kubernetes pods via `kubectl`
35
-
- Windows Event Logs (in test mode via `powershell` and reading via `wevtutil`) and application logs from Windows file system.
36
-
- Filtering lists to find the desired journal.
37
+
- Kubernetes pods via `kubectl`.
38
+
- Windows Event Logs via `PowerShell` and `wevtutil`, as well as application logs from Windows file system.
37
39
38
40
Supports 3 filtering modes:
39
41
40
42
-**Default** - case sensitive exact search.
41
-
-**Fuzzy** - custom inexact case-insensitive search (searches for all phrases separated by a space anywhere on a line).
42
-
-**Regex** - search with regular expression support (based on the built-in [regexp](https://pkg.go.dev/regexp) library), caseinsensitive by default (in case a regular expression syntax error occurs, the input field will be highlighted in red).
43
+
-**Fuzzy**(like `fzf`) - custom inexact case-insensitive search (searches for all phrases separated by a space anywhere on a line).
44
+
-**Regex**(like `grep`) - search with regular expression support, based on the built-in [regexp](https://pkg.go.dev/regexp) library, case-insensitive by default (in case a regular expression syntax error occurs, the input field will be highlighted in red).
43
45
44
46
## Coloring
45
47
@@ -50,7 +52,7 @@ Supported coloring groups for output:
50
52
-**Green** - keywords indicating success.
51
53
-**Red** - keywords indicating error.
52
54
-**Blue** - statuses (info, debug, etc), actions (install, update, etc) and HTTP methods (GET, POST, etc).
53
-
-**Light blue** - numbers (date, time, bytes, versions, percentage, IP and MAC addresses).
55
+
-**Light blue** - numbers (date, time, bytes, versions, percentage, integers, IP and MAC addresses).
54
56
55
57
A full list of all keywords can be found in the [color.log](/color.log) file (used for testing only). If you have suggestions for improving coloring (e.g. adding new words), you can open an [issue](https://github.com/Lifailon/lazyjournal/issues) for a new feature.
56
58
@@ -62,12 +64,12 @@ Binaries are available for download on the [releases](https://github.com/Lifailo
62
64
63
65
List of supported systems and architectures in which functionality is checked:
64
66
65
-
| OS | amd64 | arm64 | Systems |
66
-
| - | - | - | - |
67
-
| Linux | ✔ | ✔ | Raspberry Pi (`aarch64`), Oracle Linux (RHEL-based in WSL environment), Arch Linux, Rocky Linux, Ubuntu Server 20.04.6 and above|
68
-
| Darwin | ✔ | ✔ | macOS Sequoia 15.2 `x64` on MacBook and the `arm64` in GitHub Actions|
69
-
| BSD | ✔ || OpenBSD 7.6 and FreeBSD 14.2|
70
-
| Windows | ✔ || Windows 10 and 11|
67
+
| OS | amd64 | arm64 | Systems |
68
+
| - | - | - | - |
69
+
| Linux | ✔ | ✔ | Raspberry Pi (`aarch64`), Oracle Linux (RHEL-based in WSL environment), Arch Linux, Rocky Linux, Ubuntu Server 20.04.6 and above.|
70
+
| Darwin | ✔ | ✔ | macOS Sequoia 15.2 `x64` on MacBook and the `arm64` in GitHub Actions.|
71
+
| BSD | ✔ || OpenBSD 7.6 and FreeBSD 14.2.|
72
+
| Windows | ✔ || Windows 10 and 11.|
71
73
72
74
### Unix-based
73
75
@@ -110,6 +112,29 @@ Use the following command to install `lazyjournal` using [Homebrew](https://form
110
112
brew install lazyjournal
111
113
```
112
114
115
+
### Docker (Debian-based)
116
+
117
+
To run the interface in a container, download [docker-compose](/docker-compose.yml) and use the image from [Docker Hub](https://hub.docker.com/r/lifailon/lazyjournal):
The image is based on Debian with `systemd` and docker cli pre-installed. The necessary **read-only** permissions are already preset in `docker-compose` to support all log sources from the host system (review it to customize for your individual use).
127
+
128
+
Supports running in the web interface via [ttyd](https://github.com/tsl0922/ttyd) and mouse control. To do this, edit the variables in the `.env` file:
129
+
130
+
```shell
131
+
TTYD=true
132
+
PORT=5555
133
+
# Credentials for accessing the Web interface (optional)
134
+
USERNAME=admin
135
+
PASSWORD=admin
136
+
```
137
+
113
138
### Windows
114
139
115
140
Use the following command to quickly install in your PowerShell console:
@@ -144,15 +169,33 @@ go install github.com/Lifailon/lazyjournal@latest
144
169
145
170
You can run the interface from anywhere:
146
171
147
-
```shell
148
-
lazyjournal # Run interface
149
-
lazyjournal --help, -h # Show help
150
-
lazyjournal --version, -v # Show version
151
-
lazyjournal --audit, -a # Show audit information
172
+
```
173
+
lazyjournal Run interface
174
+
lazyjournal --help, -h Show help
175
+
lazyjournal --version, -v Show version
176
+
lazyjournal --audit, -a Show audit information
177
+
lazyjournal --tail, -t Change the number of log lines to output (default: 100000, range: 5000-200000)
178
+
lazyjournal --update, -u Change the auto refresh interval of the log output (default: 5, range: 2-10)
lazyjournal --command-color, -c Coloring in command line mode
152
181
```
153
182
154
183
Access to all system logs and containers may require elevated privileges for the current user.
155
184
185
+
Information in the subtitle of the `Logs` window:
186
+
187
+
-`tail` - maximum number of log lines to load.
188
+
-`update` - current output auto-update status (disabled when manually scrolling the output).
189
+
-`interval` - auto-update interval for output in seconds (file logs are updated only when there are changes).
190
+
-`color` - whether the output coloring mode is currently enabled or disabled.
191
+
192
+
Also output coloring is supported in command line mode:
193
+
194
+
```shell
195
+
alias lj=lazyjournal
196
+
cat /var/log/syslog | lj -c
197
+
```
198
+
156
199
## Build
157
200
158
201
Clone the repository and run the project:
@@ -195,17 +238,19 @@ Testing in BSD-based systems is done in a home environment using [usup](https://
195
238
-`F1` - show help on hotkeys.
196
239
-`Tab` - switch between windows.
197
240
-`Shift+Tab` - return to previous window.
198
-
-`Left/Right` - switch between journal lists in the selected window.
199
241
-`Enter` - selection a journal from the list to display log output.
242
+
-`Left/Right` - switch between journal lists in the selected window.
200
243
-`<Up/PgUp>` and `<Down/PgDown>` - move up and down through all journal lists and log output, as well as changing the filtering mode in the filter window.
201
244
-`<Shift/Alt>+<Up/Down>` - quickly move up and down through all journal lists and log output every `10` or `100` lines (`500` for log output).
202
245
-`<Shift/Ctrl>+<U/D>` - quickly move up and down (alternative for macOS).
203
246
-`Ctrl+A` or `Home` - go to top of log.
204
247
-`Ctrl+E` or `End` - go to the end of the log.
248
+
-`Alt+Left/Right` - change the number of log lines to output (default: `100000`, range: `5000-200000`).
249
+
-`Shift+Left/Right` - change the auto refresh interval of the log output (default: `5`, range: `2-10`).
205
250
-`Ctrl+Q` - enable or disable built-in output coloring.
206
251
-`Ctrl+S` - enable or disable coloring via [tailspin](https://github.com/bensadeh/tailspin).
207
252
-`Ctrl+R` - update all log lists.
208
-
-`Ctrl+W` - clear text input field for filter to quickly update current log output without filtering.
253
+
-`Ctrl+W` - clear text input field for filter to quickly update current log output.
209
254
-`Ctrl+C` - exit.
210
255
211
256
## Contributing
@@ -215,14 +260,15 @@ Since this is my first Go project, there may be some bad practices, BUT I want t
215
260
Thanks to all participants for their contributions:
216
261
217
262
-[Matteo Giordano](https://github.com/malteo) for upload and update the package in `AUR`.
218
-
-[Ueno M.](https://github.com/eunos-1128) for upload and update the package in `homebrew` and `conda`.
263
+
-[Ueno M.](https://github.com/eunos-1128) for upload and update the package in `Homebrew` and `Conda`.
219
264
220
265
You can also upload the package yourself to any package manager you use and make [Pull Requests](https://github.com/Lifailon/lazyjournal/pulls).
221
266
222
267
## Alternatives
223
268
224
-
-[lnav](https://github.com/tstack/lnav) - The Logfile Navigator is a **log file** viewer for the terminal.
225
-
-[Dozzle](https://github.com/amir20/dozzle) - is a small lightweight application with a web based interface to monitor **Docker logs**.
269
+
-[Lnav](https://github.com/tstack/lnav) - The Logfile Navigator is a log file viewer for the terminal.
270
+
-[TooLong](https://github.com/Textualize/toolong) - A terminal application to view, tail, merge, and search log files.
271
+
-[Dozzle](https://github.com/amir20/dozzle) - A small lightweight application with a web based interface to monitor Docker logs.
226
272
227
273
If you like using TUI tools, try [multranslate](https://github.com/Lifailon/multranslate) for translating text in multiple translators simultaneously and LLM, with support for translation history and automatic language detection.
0 commit comments