4. gen_event Behaviour
4 gen_event Behaviour
This section is to be read with the gen_event(3)
manual page in STDLIB, where all interface functions and callback functions are described in detail.
4.1 Event Handling Principles
In OTP, an event manager is a named object to which events can be sent. An event can be, for example, an error, an alarm, or some information that is to be logged.
In the event manager, zero, one, or many event handlers are installed. When the event manager is notified about an event, the event is processed by all the installed event handlers. For example, an event manager for handling errors can by default have a handler installed, which writes error messages to the terminal. If the error messages during a certain period is to be saved to a file as well, the user adds another event handler that does this. When logging to the file is