Point logrotate at a log in a folder that an app’s own user or group can write to, and it refuses with skipping "/var/log/myapp/app.log" because parent directory has insecure permissions. That isn’t fussiness. logrotate runs as root, and renaming and creating files as root in a directory someone else controls is an old trick to make root write where it shouldn’t.
The fix is the su directive, which tells logrotate to handle that log as a given user and group:
/var/log/myapp/*.log {
su myapp myapp
create 0640 myapp myapp
weekly
rotate 4
compress
}
Now the rotation in /var/log/myapp runs as myapp, which owns that folder already, so there’s nothing left to abuse. The man page recommends exactly this: when logrotate runs as root, use su for directories that are directly or indirectly under the control of non-privileged users. The full error message even tells you to set it.
Taking group and world write away from the folder also makes the message go away, but then the app may no longer be allowed to create its log there. With su you don’t have to change the permissions at all, which is why I’d go this way.
One thing to watch: the user in su must be allowed to create files with the owner and mode you ask for in create. Ask for root as owner while rotating as myapp and logrotate gives you an error.
Further reading: logrotate(8) man page, logrotate source code on GitHub