[systemd-devel] Make journalctl start at the end of the journal by default

Lennart Poettering lennart at poettering.net
Mon Aug 18 06:27:06 PDT 2014

On Mon, 18.08.14 14:46, Philippe De Swert (philippedeswert at gmail.com) wrote:

> Hi,
> Having to often use journalctl it has slowly driven me insane with
> the default options not matching common use cases.
> Attached is already a patch to start the journal at the end. Usually
> people check the logs when something went wrong, and don't care
> about what happened three weeks ago at the beginning of the log. Yes
> you can press the "end" key to skip to the end but in some cases
> that freezes up the console for over a minute.

Well, its more complex than that. I know that a lot of people do
"journalctl -b" more often than "journalctl -e". I really don#t want to
be in the business of saying that "-e" is the way to go and "-b" is
not. I am pretty sure we should choose defaults that are obvious, and I
figure showing all the logs is the most obvious thing to do, if you
don't specify anything.

Moreover, journalctl is frequently now used in scripts, we cannot change
the defaults really now, that would break all scripts. journalctl is API now.

I'd recommend to simple set a shell alias to map "journalctl" to
"journalctl -e" if that's what you prefer. That way you maintain API
compatibility while simplifying what you have to type the way you
prefer. (Actually, you could even map "j" to "journalctl -e", making
things even easier to type).

> Other gripes are --no-pager... way too long to type on a virtual
> keyboard when you are trying to use the logs old style with common
> unix utilities. Maybe not having it by default, or introducing a
> shorter command switch should not be hard to add.

Hmm? Note that the pager is turned off automatzically if you use
journalctl in a pipe. "--no-pager" is nothing you ever should need to
type manually...

> And also I would like to see the full logs always by default.
> Usually after lots of searching you find the offending log entry for
> the error, only to find out you forgot to pass the right command
> line options to journalctl and the important bit is cut off.

cut off? You can just scroll to the right in most pagers, such as less?


Lennart Poettering, Red Hat

More information about the systemd-devel mailing list