How to configure rsyslogd

DilOS platform replaced illumos syslog to a more flexible syslog daemon rsyslogd and from time to time you need to tune it for some reason. For example, most systems based on linux use /dev/log to communicate with the daemon to log their events, it is a soft link to a UNIX-socket which is listened by syslogd. In Solaris and illumos based systems /dev/log is not a socket, is is a STREAMS software device driver and you cannot communicate with the daemon via this device as it was a socket. See log(7D) for more info. We offer you to tune the daemon configuration to use a UNIX socket for your local programs, for example, /var/run/syslog.sock. Just add follow lines in the primary configuration file (/etc/rsyslog.conf) or place this code into a separated file (/etc/rsyslog.d/imuxsock.conf):

module(load="imuxsock") # needs to be done just once
input(type="imuxsock"
	Socket="/var/run/syslog.sock"
	CreatePath="on")

And don't forget to restart the rsyslog daemon:

server# svcadm restart svc:/system/rsyslogd:default

Now you can try it:

root@dvm:~# logger -s Test
<13>Jan 23 11:28:33 denis: Test
root@dvm:~# tail -f /var/log/messages 
Jan 23 11:26:48 dvm pseudo: [ID 129642 kern.info] pseudo-device: nsmb0
Jan 23 11:26:48 dvm genunix: [ID 936769 kern.info] nsmb0 is /pseudo/nsmb@0
Jan 23 11:26:48 dvm isa: [ID 202937 kern.info] ISA-device: fdc0
Jan 23 11:26:48 dvm isa: [ID 202937 kern.info] ISA-device: pit_beep0
Jan 23 11:26:48 dvm genunix: [ID 936769 kern.info] pit_beep0 is /pci@0,0/isa@1/pit_beep
Jan 23 11:26:48 dvm genunix: [ID 460718 kern.warning] WARNING: probe_node: sgen0: illegal probe(9E) value
Jan 23 11:26:48 dvm genunix: [ID 460718 kern.warning] WARNING: probe_node: sgen0: illegal probe(9E) value
Jan 23 11:26:48 dvm genunix: [ID 460718 kern.warning] WARNING: probe_node: sgen0: illegal probe(9E) value
Jan 23 11:26:48 dvm genunix: [ID 127566 kern.info] device pciclass,030000@2(display#0) keeps up device sd@0,0(sd#0), but the former is not power managed
Jan 23 11:28:33 dvm denis: Test

So, it works!

Of course, our logger knows location of the socket (/var/run/syslog.sock), but your software may be compiled by default (i.e. it uses /dev/log). In this case just specify the location manually:

root@dvm:~# logger -u /var/run/syslog.sock -s Test2
<13>Jan 23 11:33:19 denis: Test2

Consult documentation to your software how to specify the right syslog socket. In our logger example it is -u option, your software uses different one.


How to configure remote logging

Comming soon...