This is my first post to the community. We are trying to figure out how to enable log (access.log, messages etc ) rotations for Kong API gateway, our gateways are deployed on EC2 instances (CentOS Linux release 7.9.2009 (Core)). Please let me know if additional information required?
Find your log rotate config folder and add the config specific to your logs files. Its usually under,
/etc/logrotate.d/
Create a new entry file say kong-nginx and add below entry and restart the logrotate process,
/usr/local/kong/logs/*.log {
su kong kong
rotate 14
daily
missingok
compress
delaycompress
notifempty
sharedscripts
postrotate
if [ -f /usr/local/kong/pids/nginx.pid ]; then
kill -USR1 `cat /usr/local/kong/pids/nginx.pid`
fi
endscript
}