syslog, Solaris, Debian and LabVIEW

In the course of solving a LabVIEW/cRIO problem, we added syslog support to the code and found it very useful.

Syslog (See http://en.wikipedia.org/wiki/Syslog) is an old Unix standard for centralized logging. You simply send short UDP packets, in ASCII, to port 514 on the logging host, and they are saved to a persistent logfile. (See http://tools.ietf.org/html/rfc3164 for protocol details)

So all that the labview has to do is

- Open a UDP socket to port 514 on the loghost
- Send a string out the socket
- Close it

The string is like this

<10>{message}

Where 1 means user message, code 0 is alert. See http://code.google.com/p/oss-dataturbine/wiki/SyslogLevels

We've just enabled this on niagara, so we'll modify the labview code to syslog there instead of the temporary host we're using now. You can also generate test messages netcat:

 echo '<10>code 10 three' | nc -w 1 -u niagara.sdsc.edu 514

We also plan to use syslog elsewhere, for example the SQL code can syslog errors that it sees. Very useful to have them centralized in one place. It'd also be easy to send the centralized log into DataTurbine as a text channel.

See http://www.cuddletech.com/blog/pivot/entry.php?id=642 for more info on syslog and its behaviour on Solaris.