Rsyslog outputting to custom log file

Solution 1:

Well I finally figured it out. I wish someone had answered this for me. Took several days to figure out what was wrong, but I guess there just aren't very many people on superuser.

The issue was with the file permissions of the custom log file as I originally theorized. I thought I had the permissions correct, but it turns out the owner needs to be "syslog" and the group "adm". I determined this by comparing to the user.log file. Once permissions were modified and tested again, all works perfectly! I hope this helps someone else out there quicker than I was able to find answer.

Here are the final permissions

-rw-r--r-- 1 syslog adm 0 Aug  3 05:09 anm.log

Solution 2:

@Atomiklan mentioned he had to change the owner/group of his custom file to syslog/adm. I tried that and it worked...

But the comment from @MichaelKjörling seemed right, too: why not just let the syslog daemon create the file?

The key in my case (and I suggest the OP's) is that the syslog user did not have write permission to my custom log's directory. I did a chmod o+w, restarted rsyslog, and my log file happily appeared where it should have... with syslog/adm as the user/group.