Introduction
Log rotation helps keep log files from growing too large and using too much disk space. It automatically renames old logs and creates new ones so your server runs smoothly without manual cleanup.
When your nginx access or error logs grow very large and slow down your server.
When you want to keep logs organized by date for easier troubleshooting.
When disk space is limited and you need to delete old logs automatically.
When you want to compress old logs to save storage.
When you want to keep a fixed number of old log files for audit purposes.