Gentoo Archives: gentoo-user

From: lee <lee@××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] syslog-ng: how to read the log files
Date: Mon, 23 Feb 2015 00:09:02
Message-Id: 87mw45lci8.fsf@heimdali.yagibdah.de
In Reply to: Re: [gentoo-user] syslog-ng: how to read the log files by Jan Sever
1 "Jan Sever" <n32@×××××.cz> writes:
2
3 > On 02/19/2015 08:02 PM, Fernando Rodriguez wrote:
4 >> On Tuesday, February 17, 2015 7:26:05 PM lee wrote:
5 >>> Hi,
6 >>>
7 >>> how do you read the log files when using syslog-ng?
8 >>>
9 >>> The log file seem to be some sort of binary that doesn't display too
10 >>> well in less, and there doesn't seem to be any way to read them.
11 >>>
12 >>>
13 >>>
14 >>
15 >> You can just pipe the output of strings /var/log/messages to less. You can
16 > use
17 >> strings(1) for systemd  journal files also.
18 >
19 > Yeah and you can check whether it contains any binary data by
20 > diff <(strings /var/log/messages) /var/log/messages
21
22 Well, yes; see it this way:
23
24 I never used syslog-ng before. When I had to fix some problems, I
25 wanted to read the log files. Less showed them in some hexl-mode, and
26 it has never done anything like that before. I didn't even know that it
27 has this hexl-mode.
28
29 So I googled for how to read those log files because I figured that
30 syslog-ng perhaps uses some stupid binary format and that there might be
31 some program you're supposed to read them with. That didn't turn up
32 anything and it really sucked.
33
34 How am I supposed to know that there's a combination of a three-year-old
35 bug and totally unexpected behaviour of less preventing me from reading
36 these logs?
37
38
39 Try something like 'less /boot/vmlinuz-3.17.8-gentoo-r1' and you don't
40 get hexl-mode. Why such a surprise when trying to read a log file?
41
42
43 --
44 Again we must be afraid of speaking of daemons for fear that daemons
45 might swallow us. Finally, this fear has become reasonable.