Custom Event
Description: When the API function 'zend_monitor_custom_event' is called from inside PHP code, it generates an event. When enabled an event will be generated and displayed in the Monitoring | Events.
Information Collected:
The most important details are:
- Function Name - As displayed in the Issue’s General Details
- Function Arguments - The arguments of the function that triggered the event are listed in the Function Data tab.
- user_data - if specified in the function call that triggered the event it will display additional user defined data.
In most cases, these details alone should be enough to indicate what happened to trigger an event.
Applicable Diagnostic Actions:
Click on a link to see how to perform each action. Tools are listed in order of relevance to helping solve the event:
- Run the Debugger
Possible Causes and Solutions:
Custom Events are defined by users according to specific requirements. These events can only be triggered by specific code in a specific application and therefore it is only possible to say that the application's logic triggered the event.
There are certain circumstances where applying a Custom Event can be useful:
-
When handling logging routines and exceptions by adding a call to 'zend_monitor_custom_event' with the data that has been logged or held in the exception.
-
In logical closure situations. For example when handling inputs that require monitoring the value of the input (for different actions) to prevent inputting values that are not acceptable for the business logic. Adding the function 'zend_monitor_custom_event' will give you the ability to trigger an event when an unacceptable value is passed and also provide the necessary backtrace information to understand how the value got there.