golang系统日志失败:Unix系统日志传送错误

I'm on OSX running Mavericks 10.9.2. I'm trying to get my Revel app logging to syslog. My code is failing on this line:

sysLog, err := syslog.New(syslog.LOG_NOTICE|syslog.LOG_LOCAL0, "myApp")

with this error:

Unix syslog delivery error

Syslog is definitely running on my machine. What could be the problem?

Verify syslog is running or else enable it.

$ ps -aux | grep syslog
root 11703  0.0  0.4 14424 1992  -  IsJ   9:17AM 0:00.01 /usr/sbin/syslogd -ss

Now verify syslog is running in the expected local address. The log/syslog package looks for syslog in /var/run/syslog or /dev/log. If it does not find it there, you see the "Unix syslog delivery error" as per http://golang.org/src/pkg/log/syslog/syslog_unix.go.

To find the local address of syslog use the sockstat command

$sockstat
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS      
root     login      12104 3  dgram  -> /var/run/logpriv  
root     login      11791 3  dgram  -> /var/run/logpriv
root     cron       11754 4  dgram  -> /var/run/logpriv
root     syslogd    11703 4  dgram  /var/run/log
root     syslogd    11703 5  dgram  /var/run/logpriv

In above case, syslog is running at /var/run/log. So, I created a symlink from /var/run/log to /var/log/syslog and the error goes away.

$ln -sf /var/run/log /var/run/syslog