As far as I know, the mod_log_config module does not accept variables for file names so that excludes the most straightforward possibility. Apache-based solutions you can actually use include basically:
Said that, I think PHP has pretty good built-in logging. You can do exactly what you are asking for with the error_log()
function (together with e.g. date('Y-m-d')
). You can even define a different file for different error types. Sure, that will not capture errors that prevent PHP code from running (such as parse errors, request time-outs...) but you can set the error_log
directive as fallback mechanism—these situations should be rare enough to keep the log file manageable.
One more thought: make sure your development box has full error reporting enabled (many devs use third-party bundles with default settings and happily write buggy code). It isn't normal to have so many logged errors in a production server.