The specification for syslog() is
void syslog(int priority, const char *format, ...);
and your call uses buf as the format parameter, but its content does not contain any format control characters, and your call does not include any parameters. If you rewrite it as
syslog(level, "%s", buf);
it should work OK.
Just say 'NO' to evaluated arguments for diadic functions! Ash