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

Philippe De Swert philippedeswert at gmail.com
Mon Aug 18 07:19:14 PDT 2014


Thanks for answering.

On 18/08/14 16:27, Lennart Poettering wrote:
> On Mon, 18.08.14 14:46, Philippe De Swert (philippedeswert at gmail.com) wrote:
> 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 could argue that most people who use -b might not know about -e, or
that scripts would not use default journalctl behaviour. (I actually
included a -s option in the patch to have journalctl with the old
behaviour) But this will only degrade in a personal preferences game I

> 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).

I did explain I knew what aliases were and why they would not work.
Constantly changing environment, needing to make sure something does not
magically work on one device due to aliases and not on another etc...

>> 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...

Had not noticed that. Got used to hurt my fingers and typing --no-pager
the whole time. Good to know, thanks.

>> 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?

Good luck doing that when you don't have arrow keys available. Moreover
I still believe wrapping would be more useful. But personal preferences
again I guess.

So I guess I will just maintain the patches for our internal use then,
if we chose to do so at the cost of diverging from upstream. At least
the people here like the behaviour I proposed. If anybody else wants the
patches I will gladly provide them.



More information about the systemd-devel mailing list