[syslog-ng] Is logger an effective test tool on Solaris 10?

Balazs Scheidler bazsi at balabit.hu
Mon Jul 26 16:47:35 CEST 2010


On Wed, 2010-07-21 at 10:36 -0700, Chuck wrote:
> 
> I am using the following script to test syslog-ng. (Running this from
> the same machine as the syslog-ng server):
> 
> #!/bin/bash
> 
> d=`date '+%y%m%d_%H%M%S'`
> logger -p kern.debug    "__kern.debug__ $d"
> sleep 1;
> 
> 
> d=`date '+%y%m%d_%H%M%S'`
> logger -p kern.crit     "__kern.crit__ $d"
> sleep 1;
> 
> d=`date '+%y%m%d_%H%M%S'`
> logger -p kern.info     "__kern.info__ $d"
> sleep 1;
> 
> However, here is how the messages are being seen within syslog-ng:
> Jul 21 10:30:35 log01 cars: [ID 702911 user.debug] __kern.debug__
> 100721_103035
> Jul 21 10:30:36 log01 cars: [ID 702911 user.crit] __kern.crit__
> 100721_103036
> Jul 21 10:30:37 log01 cars: [ID 702911 user.info] __kern.info__
> 100721_103037
> 
> The facility is being seen as user and not kern...

the "kern" facility has a numeric value of zero and in this case logger
automatically uses "user". So this is a client issue.

If you really want to send "kern" messages, you have to construct the
messages using netcat.

For example:

echo '<5> prog: message' | nc -u localhost 514

But if you also open a pipe from syslog-ng, you could do the same with
plain "echo".

-- 
Bazsi



More information about the syslog-ng mailing list