[REBOL] Re: output to syslog
From: santilli::gabriele::gmail::com at: 6-Jul-2007 10:14
2007/7/5, Gregg Irwin <gregg-pointillistic.com>:
> JB> Can Rebol output a syslog message?
>
> I haven't tried it, but from the spec it just means writing 1024 bytes
> or less over UDP on port 514 so, yes, REBOL should be able to do that.
Or, having library access:
libc: if-error [load/library %libc.so] [if-error [load/library %libc.so.6] [
print "FATAL: Unable to load libc.so!"
quit
]]
openlog:
make routine! [
ident [string!]
option [integer!]
facility [integer!]
] libc "openlog"
syslog:
make routine! [
priority [integer!]
format [string!]
str [string!]
] libc "syslog"
; done this way to avoid the GC destroying the string
ident-string: "your ident string"
LOG_DAEMON: 16
openlog ident-string 0 LOG_DAEMON ; use your own options and
facility - see man page
; now you can call syslog
HTH,
Gabriele