kardianos / service

Run go programs as a service on major platforms.
zlib License
4.45k stars 678 forks source link

How can I set syslog facility #399

Open takafumi-kataoka opened 3 months ago

takafumi-kataoka commented 3 months ago

It appears that there is no way to set the syslog facility for applications of type service_systemd_linux. The first argument passed to the syslog.New function is fixed to syslog.LOG_INFO, which results in the facility always being set to kern.

https://github.com/kardianos/service/blob/becf2eb62b83ed01f5e782cb8da7bb739ded2bb5/service_unix.go#L23

Is there any workaround for this issue?

takafumi-kataoka commented 3 months ago

It would be better to set syslog.LOG_USER | syslog.LOG_INFO.