concept gen_event behaviour in category erlang

This is an excerpt from Manning's book Erlang and OTP in Action.
You need to put an end to the silent treatment the cache is currently giving you, and Erlang/OTP has pretty good facilities for doing so. These facilities are the logging application, the SASL application, and the event handling infrastructure that the gen_event behaviour provides. Together, they give you a powerful tool for communicating various types of information to the world at large. The gen_event system even gives you a way to allow other applications to hook into your system.
The logging facility is based on Erlang’s event handling framework, which uses the gen_event behaviour. This behaviour wraps up pretty much everything you need from an event handler in a nice, easy-to-use interface. To plug into the logging infrastructure, you need to write a new gen_event behaviour implementation module. Fortunately, that’s simple. The gen_event behaviour interface is similar to that of the gen_server behaviour: it has the familiar init, code_change, and terminate callback functions, and it also requires the handle_call and handle_info callbacks. (There are some subtle differences when it comes to arguments and return values, so don’t assume too much without checking the documentation.) But the gen_event interface replaces handle_cast/2 with handle_event/2; and as you may be able to guess, that’s where you receive your error-logger events.