logrotate config that actually works: how to rotate app logs without dropping log lines and without making the app crash on the rename

Your app writes to /var/log/app.log. The disk fills up. You write a quick logrotate config, copy-paste from the first Stack Overflow result, set up a daily rotate. Two months later the disk is fine but you discover the app …