Add rotation of API and frontend logs (fixes #7737)