This is a major-mode for emacs to view systemd’s journalctl output in emacs. The output is split into chunks for performance reasons.
Fontification is provided and may be customized.
At the moment it is still in very early development. Please give feedback on any problems that occure.
Clone the project or download journalctl-mode.el and put that file to a load-path.
Put down
( require 'journalctl-mode)
in your .emacs file.
At the moment there are to functions provided to call journalctl:
- journalctl: will ask for commandline parameters like “-xe” and show the output in the ∗journalctl∗ buffer.
- journalctl-boot: will provide you with the list of boots in the journal. You can choose one and view it in the buffer.
- journalctl-unit: will provide you with the list of units . You can choose one and view related logs in the buffer.
- journalctl-user-unit: will provide you with the list of user-units . You can choose one and view related logs in the buffer.
In journalctl-mode you can navigate between the cunks with “n” (next chunk) and “p” (previous chunk). I also redefined C-v and M-v so that it will move to the next chunk, when you have reached the bottom or top of the buffer.
You can add parameters from journalctl-mode with “+ +”.
There are also some keybindings to add parameters:
- ”+ r” : Reverse output (–reverse).
- ”+ x”: Augment log lines with explanation texts from the message catalog. (–catalog).
- ”+ s”: Show messages from system services and the kernel only (–system).
- “+u”: Show messages from service of current user only (–user).
- “+k”: Show kernel message only (–dmesg). This applies “-b”.
- “+p” prompt for priority range and show the respective messages (–priority).
- “+S”: Show messages since given date and / or time (–since).
- “+U”: Show messages until given date and / or time (–until).
You can edit the current parameters with “e”.
You can grep on the current output of journalctl with “+ g”. You will be asked for a pattern to grep.
You can remove all filters (grep) with “- -“.
Type “q” to kill the “∗journalctl∗” buffer.