Gentoo Archives: gentoo-user

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

Replies

Subject Author
Re: [gentoo-user] syslog-ng: how to read the log files covici@××××××××××.com
Re: [gentoo-user] syslog-ng: how to read the log files covici@××××××××××.com