30.07.2012 Views

Reference Guide

Reference Guide

Reference Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Zend Server <strong>Reference</strong> Manual<br />

Event Rules<br />

Custom Event<br />

Description: When the API function 'zend_monitor_custom_event' is called from inside PHP code, it<br />

generates an event. When enabled an event will be generated and displayed in the Monitor | Events.<br />

Information Collected:<br />

The most important details are:<br />

420<br />

• Function Name - As displayed in the Issue’s General Details<br />

• Function Arguments - The arguments of the function that triggered the event are listed in the<br />

Function Data tab.<br />

• user_data - if specified in the function call that triggered the event it will display additional user<br />

defined data.<br />

In most cases, these details alone should be enough to indicate what happened to trigger an event.<br />

Applicable Diagnostic Actions:<br />

Click on a link to see how to perform each action. Tools are listed in order of relevance to helping solve<br />

the event:<br />

1. Run the Debugger<br />

Possible Causes and Solutions:<br />

Custom Events are defined by users according to specific requirements. These events can only be<br />

triggered by specific code in a specific application and therefore it is only possible to say that the<br />

application's logic triggered the event.<br />

There are certain circumstances where applying a Custom Event can be useful:<br />

1. When handling logging routines and exceptions by adding a call to 'zend_monitor_custom_event'<br />

with the data that has been logged or held in the exception.<br />

2. In logical closure situations. For example when handling inputs that require monitoring the value<br />

of the input (for different actions) to prevent inputting values that are not acceptable for the<br />

business logic. Adding the function 'zend_monitor_custom_event' will give you the ability to<br />

trigger an event when an unacceptable value is passed and also provide the necessary backtrace<br />

information to understand how the value got there.<br />

3. More...

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!