Squid cannot log to syslog

rsyslogsquid

According to this documentation:
http://www.squid-cache.org/Doc/config/access_log/

squid should be able to log to rsyslog with the following directives:

access_log syslog:daemon.info squid
cache_log  syslog:daemon.info squid

However when I try to restart it I get:

WARNING: Cannot write log file: syslog:daemon.info
syslog:daemon.info: Permission denied
         messages will be sent to 'stderr'.

I have tried all facilities from local0-local7 as well it says the same thing.
It seems rsyslog is disallowing squid to log into it. Squid is running with the proxy user.

Any idea how to fix this?

Best Answer

Well this wasn't easy to fix, was done by mostly experimenting:

Only the:

access_log syslog squid
cache_log syslog squid 

Directives in the config are working and even they will produce the same error at the start of Squid 3:

ARNING: Cannot write log file: syslog
syslog: Permission denied
         messages will be sent to 'stderr'.

Anything else, including using the -s will not work! Once these directives are applied, Squid will completely stop logging to the access.log and cache.log files.

Unfortunately without defining facilities this will flood both messages+syslog files but I will leave that to rsyslog rules to filter them out.