Gentoo Archives: gentoo-user

From: Marc Joliet <marcec@×××.de>
To: gentoo-user@l.g.o
Subject: systemd journal location (was: Re: [gentoo-user] syslog-ng: how to read the log files)
Date: Wed, 18 Feb 2015 19:01:47
Message-Id: 20150218200132.3611e750@marcec.fritz.box
In Reply to: Re: [gentoo-user] syslog-ng: how to read the log files by Marc Joliet
1 Am Tue, 17 Feb 2015 23:31:26 +0100
2 schrieb Marc Joliet <marcec@×××.de>:
3
4 > Am Tue, 17 Feb 2015 13:45:38 -0600
5 > schrieb Canek Peláez Valdés <caneko@×××××.com>:
6 >
7 > > On Tue, Feb 17, 2015 at 2:29 PM, <covici@××××××××××.com> wrote:
8 > > >
9 > > > Alexander Kapshuk <alexander.kapshuk@×××××.com> wrote:
10 > > >
11 > > > > On Tue, Feb 17, 2015 at 8:26 PM, lee <lee@××××××××.de> wrote:
12 > > > >
13 > > > > > Hi,
14 > > > > >
15 > > > > > how do you read the log files when using syslog-ng?
16 > > > > >
17 > > > > > The log file seem to be some sort of binary that doesn't display too
18 > > > > > well in less, and there doesn't seem to be any way to read them.
19 > > > > >
20 > > > > >
21 > > > > > --
22 > > > > > Again we must be afraid of speaking of daemons for fear that daemons
23 > > > > > might swallow us. Finally, this fear has become reasonable.
24 > > > > >
25 > > > > >
26 > > > > If you're talking about /var/log/messages, which is:
27 > > > > messages: data
28 > > > >
29 > > > > I use cat(1).
30 > > >
31 > > > I wonder if the OP is using systemd and trying to read the journal
32 > > > files?
33 > >
34 > > Those live under /var/lib/journal (which you need to create; Gentoo doesn't
35 > > do it by default last time I saw)
36 > [...]
37 >
38 > It did on my laptop after I migrated it to systemd over the weekend (on a whim,
39 > no less -- apparently I'm adventurous?). Or, to be more precise, I didn't have
40 > to create the directory myself. And wouldn't it be created at run-time, anyway?
41 > That's what I would expect, at least.
42
43 Dammit, I *wanted* to mention that I didn't have my laptop there to look, and
44 now I regret not doing it, because I was *actually* thinking
45 of /var/log/journal/ (which I still didn't create by hand, BTW).
46
47 I mean, it still contains journal files, and systemd-journald(8) says its the
48 default *persistent* journal location. However, it is structured differently
49 than what you showed, namely:
50
51 % tree /var/log/journal/
52 /var/log/journal/
53 ├── b3a495d35e890b80816684a4521fc1cc
54 │   ├── system.journal
55 │   └── user-1000.journal
56 └── remote
57
58 So it creates a directory named after the machine ID, which contains a system
59 journal and one journal per user. And if it receives logs from remote
60 machines, those go into the remote folder.
61
62 Just, uh, just so you know...
63
64 --
65 Marc Joliet
66 --
67 "People who think they know everything really annoy those of us who know we
68 don't" - Bjarne Stroustrup