We have a web server on which we are going to run a number of applications. At the server level, we were able to handle error handling using Hyperic to notify the person responsible in the event of a / memcached database server failure.
However, we still need to handle these potential errors and log events that occur at the application level in order to improve the applications for our customers before customers find out.
So then what is a good solution for this?Using your own PHP error log: it will be quickly blocked if we run a large number of applications at the same time. This is probably not the best option if you like the structure.
One idea is to create a lightweight off-site error handling application that has a REST / JSON API that receives encrypted and serialized arrays of error messages and stores them in a database. Perhaps this may be, depending on the severity of the error, also directly inserted into our error tracker.Maybe a few hours spent, but it seems like a rather fragile solution, and I'm sure there are more reliable alternatives out there.
Thank,
Why will using PHP error_log quickly become "cloggered"? If everything goes well, you won’t see many mistakes, right?
, API, , . , , / , , , .
, , .
tail -f php , , . , ( ) , , / . , , (, var_export()/serialize() func_get_args() , . , .
tail -f
var_export()
serialize()
func_get_args()
Zend_Log, - (, , , , debug_backtrace(), , . , .., :)
Zend_Log
debug_backtrace()
: , , . , , , .
... , , , (Error-API/-Service ) : , , ? / ?
set_exception_handler set_error_handler, , "". , , script ..
set_exception_handler
set_error_handler
, . , , . ? ? ( )
, , PHP: http://de.php.net/manual/en/ref.errorfunc.php
Of particular interest is set_error_handler (), which allows you to completely override the internal PHP error handler.
With this, you can create your own logs for each application / send emails to administrators / save error information in db / inform users that the administrator has been notified or something else.
By returning true or false, you can also control the internal PHP handlers. The internal error handler should start after your function or not.
Source: https://habr.com/ru/post/1747872/More articles:xsl: for-each is not supported in this context - xmlHow to disable location services? - objective-cКак использовать регулярное выражение для удаления [a-z]/[a-z]/из строки? - javascriptChoosing a font size for a web form - ms-accesspostgresql множественная вставка с выбранным запросом - selectJava - class type from inside a static initialization block - javaCan .NET AppDomains do this? - c #https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1747875/blackberry-push-notifications-is-tomcat-mysql-really-needed&usg=ALkJrhjUPSFNvVKURyYCXroB54oSC-PkkgjQuery animate () - multiple selectors and variables, a unique call to animate () - jqueryjQuery - Multiple selectors and multiple values in an ONE call - optimizationAll Articles