replacing rsyslogd in minimal with journald [was Re: systemd requires HTTP server and serves QR codes]

Lennart Poettering mzerqung at 0pointer.de
Wed Oct 10 18:36:04 UTC 2012


On Wed, 10.10.12 09:54, Richard W.M. Jones (rjones at redhat.com) wrote:

> On Wed, Oct 10, 2012 at 09:50:43AM +0200, Björn Persson wrote:
> > Lennart Poettering wrote:
> > > On Tue, 09.10.12 09:09, Chris Adams (cmadams at hiwaay.net) wrote:
> > > > How do you read this log when the system is not running (e.g.
> > > > mounting filesystems of a drive on another system, running from a
> > > > rescue image, etc.)?
> > > 
> > > journalctl -D <pathtothejournalfiles>
> > 
> > So the rescue system (which might not always be Fedora) must have 
> > journalctl installed. Is the file format stable, or can it break if the 
> > rescue system has a different version of journalctl? Is the format 
> > perchance even documented so that other tools for reading logs could be 
> > written?
> 
> This would be essential for libguestfs tools to parse logs out of
> guests (we do it now by reading /var/log/messages etc which has all of
> the properties you state).

I'd recommend simply using our C API for this. For details see:

http://www.freedesktop.org/software/systemd/man/

Look for the various APIs with the sd_journal_ prefix. With those you
get full access to the journal. Here you find an example how to do this:

http://www.freedesktop.org/software/systemd/man/sd_journal_next.html

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the devel mailing list