简体   繁体   中英

Granular error reporting in PHP

I am not sure how to pose this question. Sorry if this is already asked somewhere else: I want to log PHP errors on screen and warnings and above in a log file. Is there a way in PHP itself to set this or do I need to program a class as error handler that decides where to log?

You may want to use set_error_handler(). You can catch the level of an error, therefore decide whether to show up or log to file.

FYI, php error handling

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM