I have a standalone debian-based system that -- for the simplicity -- can be taken as not having RTC. The system clock can be set during operation, both forwards and backwards.
I thought that journalctl should order log lines based on boot ids and sequence number if they are available, but unfortunately it seems it is not true, at least, I get journalctl outputs like this:
...
-- Boot 1b6fb8b971ce4d5f9ccc7f71b19f496d --
Jan 05 18:07:40 lumon myapp: ...
-- Boot e0f8203b0c18497ba94fd121eb1c4af9 --
Jan 05 18:07:41 lumon myapp: ...
Jan 05 18:07:41 lumon myapp: ...
-- Boot 1b6fb8b971ce4d5f9ccc7f71b19f496d --
Jan 05 18:07:42 lumon myapp: ...
Jan 05 18:07:42 lumon myapp: ...
-- Boot e0f8203b0c18497ba94fd121eb1c4af9 --
Jan 05 18:07:42 lumon dhclient[507]: DHCPDISCOVER on net0 to 255.255.255.255 port 67 interval 13
Jan 05 18:07:42 lumon sh[507]: DHCPDISCOVER on net0 to 255.255.255.255 port 67 interval 13
Jan 05 18:07:42 lumon myapp: ...
-- Boot 1b6fb8b971ce4d5f9ccc7f71b19f496d --
Jan 05 18:07:42 lumon myapp: ...
Jan 05 18:07:43 lumon myapp: ...
-- Boot e0f8203b0c18497ba94fd121eb1c4af9 --
Jan 05 18:07:43 lumon myapp: ...
...
As you can see, lines from different boots are interleaved.
This is a clear indication of the issue, but of course, if I look only one boot (by merging all the related chunks) then lines are in bad order, i.e., not in the order of creation, too.
Is there a way to get back my log lines in creation order?