Hello Andreas Henriksson
On 07/11/16 18:36, Andreas Henriksson wrote:
On Mon, Nov 07, 2016 at 04:16:16PM +0530, Charles wrote:
The logger man page says "logger - a shell command interface to the
syslog(3) system log module". man 3 syslog says "syslog() generates a log
message, which will be distributed by syslogd(8). There is no man
syslogd(8). man 8 rsyslogd says see also rsyslog.conf(5). man 5
rsyslog.conf lists /etc/rsyslog.conf as the default configuration file.
/etc/rsyslog.conf has nothing in it which I understand effects copying
messages to the systemd journal or to the "kernel log buffer" (a term which
I am not familiar with):
Yes, first the syslog(3) system call is something completely different
from a syslog daemon/server implementation! Maybe they are unfortunately
named too similarly but they've been named like this for decades and are
unlikely to be renamed. You'll just have to learn what they do.
man 3 syslog says "syslog() generates a log message, which will be
distributed by syslogd(8)
Regards,
Andreas
What about the change of PID in the tag value provided to the logger
call? That question is regards these mail excerpts which show the tag
value was set with PID 20892 and appeared in the systemd journal with
PID 20893:
>> The situation was reproduced by running this script:
>> #!/bin/bash
>> echo $$
>> logger -t "task3092.sh[$$]" 'Test message'
>>
>> The outcome was reproduced by:
>> # ./task3092.sh
>> 20892
>> # tail -1 /var/log/syslog
>> Nov 7 08:35:36 sysmgt.iciti task3092.sh[20892]: Test message
>> # journalctl | grep task3092
>> Nov 07 08:35:36 sysmgt task3092.sh[20893]: Test message
>> Given that the messsage did appear in the systemd journal, the expected
>> outcome was:
>> 1. It had the specified tag, not one with an altered PID
>> 2. It had a systemd journal format preamble, not syslog format
>
> Not sure what you're saying here really, but if you want to alter
> which meta-data is fetched from the journal for each message
> just see the journalctl manpage for which options to use.
1. The logger's -t option value had the PID of the calling process as is
conventional for syslog messages. The syslog message showed it. The
journal message showed a different PID.