use syslog only when running under linux or osx

Close #937