开发者

Does PHP error_reporting(0) affect error logging, or just display?

Does error_reporting(0); have any effect on err开发者_开发知识库or logging (to file), or does it just suppress on-screen error display?

Thanks.


Yes, it affects both.

The error_reporting level defines what levels of errors gets triggered. Whether you log or display those errors are determined by the other settings.

To summarize:

  • error_reporting: What levels of errors get triggered.
  • display_errors: Whether to show triggered errors in script output.
  • log_errors: Whether to write triggered errors to a log.

In essence, setting error_reporting(0) means that you've turned off error reporting, and nothing will be logged to file or output to the screen.


It just suppresses displayed errors. Your ini settings for error logging determine logging levels.


PHP has pretty good docs, check out

http://us.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting for what it does,

http://us.php.net/manual/en/function.error-reporting.php for the runtime function

Its effects depend on where stderr is going.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜