PHP How to correctly handle critical errors notification on a production server. -
generally errors log , such. should important errors need attention on production server. example if deleting series of orm models in process , somewhere during process model fails delete. want process delete many objects possible , not throw exceptions user. want developers or admin notified of important errors can instantly fixed.
in past had added in script email me error under circumstances. if in dev environment throw , exception, when in production die silently , email error.
is there of way high-lite exceptions more critical , hence can enable developers take action? create more generic solution. eg if critical error/exception thrown emailed admin on production, else follows normal procedure (such log).
there amazing packages provide solution i'm looking more native if possible.
you can put htaccess
file on site root following lines.
# php error handling production servers php_flag display_startup_errors off php_flag display_errors off php_flag html_errors off php_flag log_errors on php_flag ignore_repeated_errors off php_flag ignore_repeated_source off php_flag report_memleaks on php_flag track_errors on php_value docref_root 0 php_value docref_ext 0 php_value error_log /home/path/public_html/domain/php_errors.log php_value error_reporting -1 php_value log_errors_max_len 0
do not place error_log
on public accessible location.
Comments
Post a Comment