I've got a folder full of log files, and I'm using
logrotate to rotate them.
Until recently, I only had Apache log files in there - access.log and error.log. I've added a new log from a daemon, daemon.log. The daemon log is being written by a daemon running under the
When it runs,
logrotate creates a new log, with permissions of
root and group
adm. Apache can write to the access and error logs with these permissions, but my daemon, running as
As I see it, there are a few options:
- Change the
logrotateconfig to manually specify which log files are given which permissions. But this means if I add a new log file, I need to remember to configure
logrotateto manage it.
- Modify the
logrotatescript to somehow create an exception for the daemon.log file. Is that even possible?
- Move the daemon log to a new folder, with a separate
logrotatescript to manage log files in that new folder. Simple enough, but I'd like to keep all my logs together if I can.
logrotateto create the files under a different user and group. Seems like this would risk missing log information.
- Add the
www-datauser to the
admgroup, and set permissions to
660. I don't like the idea of giving the
www-datauser access to other stuff unintentionally.
- Set permissions on the log files to
666. Seems like a crude solution.
None of those is ideal, and I'm pretty sure a couple are terrible. Is there another option, or is one of these my best bet? Am I missing something?