We have a PHP intranet site that we run with warning/error logging on (as it's not under heavy load and there's a number of bugs/bad code left to find). Because the site is relatively unstable and in active development, I've been clearing the production error logs when each new version releases so I get a clean look at what problems we're having. We usually don't release until all logged problems identified in the last production build are fixed.
I still keep Apache's error logs because our code shouldn't mess up Apache (and if it does it's a huge deal), so if something's wrong there I want to know.
I'm wondering what a good practice is here; our previous code base logged hysterically verbosely so I've been trying to limit the logs so it's actually usable information, but just clearing the logs seems suspect as well.
For reference, most of the logs are undefined variables because a past programmer liked to use
if (!$var) instead of
if (empty($var)). I've been eager to remove those entries since the application doesn't perform any unexpected actions but I would get dozens of the same warning daily until we fixed it. Those are also why I left warning logging on in production.
Should I keep all my error logs for future reference? Should I segregate old logs somehow and tag them to build numbers?