Apache错误日志级别。 是否应该消除所有错误?

Question: Should I try to eliminate all the errors I get in apache error log produced by my PHP/Javascript application? The apache conf allows for the following log levels: Trace8-trace1, debug, info, warn, error, crit, alert, emerg.

So far I set the loglevel to "debug" and I get errors like "Undefined index" or "Use of undefined constant prefix" but the application seems to be working just fine..

So is there any loglevel that I should set on apache and try to make sure I get absolutely no errors?

Thanks in advance!

Yes, you should try to resolve all the errors.

The advantages of correcting all the errors are:

  • The log files will not be full of text
  • Performance will be better because PHP doesn't have to identify and react to the errors
  • Depending on the log configuration, you may save a lot of disk space
  • Your code should be more robust

On the production server, set the log level fairly high. On development servers set the log level low.