Fix syslog logic checks for `file://`, `tcp://` and `udp://`. Fixes #7754