Improved logs rotation to disallow more than 300 logs (configurable) in the logs dir.