Gentoo Archives: gentoo-user

From: covici@××××××××××.com
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] syslog-ng: how to read the log files
Date: Mon, 23 Feb 2015 19:31:34
Message-Id: 18633.1424719880@ccs.covici.com
In Reply to: Re: [gentoo-user] syslog-ng: how to read the log files by Marc Joliet
1 Marc Joliet <marcec@×××.de> wrote:
2
3 > Am Mon, 23 Feb 2015 12:10:18 -0600
4 > schrieb Canek Peláez Valdés <caneko@×××××.com>:
5 >
6 > > On Mon, Feb 23, 2015 at 11:49 AM, <covici@××××××××××.com> wrote:
7 > > >
8 > > > Canek Peláez Valdés <caneko@×××××.com> wrote:
9 > > >
10 > > > > On Mon, Feb 23, 2015 at 3:41 AM, <covici@××××××××××.com> wrote:
11 > > > > >
12 > > > > > Marc Joliet <marcec@×××.de> wrote:
13 > > > > >
14 > > > > > > Am Mon, 23 Feb 2015 00:41:50 +0100
15 > > > > > > schrieb lee <lee@××××××××.de>:
16 > > > > > >
17 > > > > > > > Neil Bothwick <neil@××××××××××.uk> writes:
18 > > > > > > >
19 > > > > > > > > On Wed, 18 Feb 2015 21:49:54 +0100, lee wrote:
20 > > > > > > > >
21 > > > > > > > >> > I wonder if the OP is using systemd and trying to read the
22 > > > > journal
23 > > > > > > > >> > files?
24 > > > > > > > >>
25 > > > > > > > >> Nooo, I hate systemd ...
26 > > > > > > > >>
27 > > > > > > > >> What good are log files you can't read?
28 > > > > > > > >
29 > > > > > > > > You can't read syslog-ng log files without some reading
30 > > software,
31 > > > > usually
32 > > > > > > > > a combination of cat, grep and less. systemd does it all with
33 > > > > journalctl.
34 > > > > > > > >
35 > > > > > > > > There are good reasons to not use systemd, this isn't one of
36 > > them.
37 > > > > > > >
38 > > > > > > > To me it is one of the good reasons, and an important one. Plain
39 > > text
40 > > > > > > > can usually always be read without further ado, be it from rescue
41 > > > > > > > systems you booted or with software available on different
42 > > operating
43 > > > > > > > systems. It can be also be processed with scripts and sent as
44 > > email.
45 > > > > > > > You can probably even read it on your cell phone. You can still
46 > > read
47 > > > > > > > log files that were created 20 years ago when they are plain text.
48 > > > > > > >
49 > > > > > > > Can you do all that with the binary files created by systemd? I
50 > > can't
51 > > > > > > > even read them on a working system.
52 > > > > > >
53 > > > > > > What Canek and Rich already said is good, but I'll just add this:
54 > > it's
55 > > > > not like
56 > > > > > > you can't run a classic syslog implementation alongside the systemd
57 > > > > journal.
58 > > > > > > On my systems, by *default*, syslog-ng kept working as usual,
59 > > getting
60 > > > > the logs
61 > > > > > > from the systemd journal. If you want to go further, you can even
62 > > > > configure
63 > > > > > > the journal to not store logs permanently, so that you *only* end up
64 > > > > with
65 > > > > > > plain-text logs on your system (Duncan on gentoo-amd64 went this
66 > > way).
67 > > > > > >
68 > > > > > > So no, the format that the systemd journal uses is most decidedly
69 > > *not*
70 > > > > a reason
71 > > > > > > against using systemd.
72 > > > > > >
73 > > > > > > Personally, I'm probably going to uninstall syslog-ng, because
74 > > > > journalctl is
75 > > > > > > *such* a nice way to read logs, so why run something whose output
76 > > I'll
77 > > > > never
78 > > > > > > read again? I recommend reading
79 > > > > > > http://0pointer.net/blog/projects/journalctl.html for examples of
80 > > the
81 > > > > kind of
82 > > > > > > stuff you can do that would be cumbersome, if not *impossible* with
83 > > > > regular
84 > > > > > > syslog.
85 > > > > >
86 > > > > > Except that I get lots of messages about the system journal missing
87 > > > > > messages when forwarding to syslog, so how can I make sure this does
88 > > not
89 > > > > > happening?
90 > > > >
91 > > > > Could you please show those messages? systemd sends *everything* to the
92 > > > > journal, and then the journal (optionally) can send it too to a regular
93 > > > > syslog. In that sense, it's impossible for the journal to miss any
94 > > message.
95 > > > >
96 > > > > The only way in which the journal could miss messages is at very early
97 > > boot
98 > > > > stages; but with a proper initramfs (like the ones generated with
99 > > dracut),
100 > > > > even those get caught. You get to put an instance of systemd and the
101 > > > > journal inside the initramfs, and so it's available almost from the
102 > > > > beginning.
103 > > > >
104 > > > > And if you use gummiboot, then you can even log from the moment the UEFI
105 > > > > firmware comes to life.
106 > > >
107 > > > So, I get lots of messages in my regular syslog-ng /var/log/messages
108 > > > like the following:
109 > > > Feb 23 12:47:52 ccs.covici.com systemd-journal[715]: Forwarding to
110 > > > syslog missed 15 messages.
111 > > >
112 > > > So, I saw a post on Google to up the queue length, and I uped it to 200,
113 > > > but no joy, still get the messages like the one above.
114 > >
115 > > Are you using the unit file provided by syslog-ng (systemd-delta doesn't
116 > > mention syslog)? Also, is /etc/systemd/system/syslog.service is a link
117 > > to /usr/lib/systemd/system/syslog-ng.service?
118 > >
119 > > I do, and I don't get any of those messages. I use the default journal
120 > > configuration. According to [1], this should be fixed.
121 >
122 > I remember getting a small number of messages like that, too, on my laptop.
123 > However, it's at the university, so I can't check now to see what types of
124 > messages were missed (if any; if I understand [1] correctly, those messages are
125 > most likely bogus?).
126 >
127 > But yeah, that's any idea, Covici: see what's in /var/log/messages, compare that
128 > to the journalctl output, and check if any messages were actually missed ("diff
129 > -U" might be of help here). And if/once you did that, what kinds of messages
130 > were missed, if any? If those messages really are bogus, you shouldn't see any
131 > differences between the two.
132 >
133 > > Regards.
134 > >
135 > > https://github.com/balabit/syslog-ng/issues/314
136 >
137 > Note that that fix would only be in the ~arch version of syslog-ng, the current
138 > stable version (3.4.8) is a few months too old.
139
140 I am up to 3.6 something, so the fix should be there. But my unit file
141 is different, so that remains to check.
142
143 --
144 Your life is like a penny. You're going to lose it. The question is:
145 How do
146 you spend it?
147
148 John Covici
149 covici@××××××××××.com

Replies

Subject Author
Re: [gentoo-user] syslog-ng: how to read the log files "Canek Peláez Valdés" <caneko@×××××.com>