Datadog: nginx access.log / error.log permission denied

Problem:

... | CORE | WARN | (pkg/logs/input/file/scanner.go:211 in startNewTailer) | open /var/log/nginx/access.log: permission denied
... | CORE | WARN | (pkg/logs/input/file/scanner.go:211 in startNewTailer) | open /var/log/nginx/error.log: permission denied

Solution:

chmod 755 /var/log/nginx
chmod 644 /var/log/nginx/*.log
chmod 644 /var/log/nginx/*.gz
nano /etc/logrotate.d/nginx # change 640 to 755 for "create" directive
This entry was posted in How to’s and tagged , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *