Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

log_mf_h(3erl) [linux man page]

log_mf_h(3erl)						     Erlang Module Definition						    log_mf_h(3erl)

NAME
log_mf_h - An Event Handler which Logs Events to Disk DESCRIPTION
The log_mf_h is a gen_event handler module which can be installed in any gen_event process. It logs onto disk all events which are sent to an event manager. Each event is written as a binary which makes the logging very fast. However, a tool such as the Report Browser ( rb ) must be used in order to read the files. The events are written to multiple files. When all files have been used, the first one is re-used and overwritten. The directory location, the number of files, and the size of each file are configurable. The directory will include one file called index , and report files 1, 2, .... . EXPORTS
init(Dir, MaxBytes, MaxFiles) init(Dir, MaxBytes, MaxFiles, Pred) -> Args Types Dir = string() MaxBytes = integer() MaxFiles = 0 < integer() < 256 Pred = fun(Event) -> boolean() Event = term() Args = args() Initiates the event handler. This function returns Args , which should be used in a call to gen_event:add_handler(EventMgr, log_mf_h, Args) . Dir specifies which directory to use for the log files. MaxBytes specifies the size of each individual file. MaxFiles specifies how many files are used. Pred is a predicate function used to filter the events. If no predicate function is specified, all events are logged. SEE ALSO
gen_event(3erl) , rb(3erl) Ericsson AB stdlib 1.17.3 log_mf_h(3erl)

Check Out this Related Man Page

alarm_handler(3erl)					     Erlang Module Definition					       alarm_handler(3erl)

NAME
alarm_handler - An Alarm Handling Process DESCRIPTION
The alarm handler process is a gen_event event manager process which receives alarms in the system. This process is not intended to be a complete alarm handler. It defines a place to which alarms can be sent. One simple event handler is installed in the alarm handler at start-up, but users are encouraged to write and install their own handlers. The simple event handler sends all alarms as info reports to the error logger, and saves all of them in a list which can be passed to a user defined event handler, which may be installed at a later stage. The list can grow large if many alarms are generated. So it is a good reason to install a better user defined handler. There are functions to set and clear alarms. The format of alarms are defined by the user. For example, an event handler for SNMP could be defined, together with an alarm MIB. The alarm handler is part of the SASL application. When writing new event handlers for the alarm handler, the following events must be handled: {set_alarm, {AlarmId, AlarmDescr}} : This event is generated by alarm_handler:set_alarm({AlarmId, AlarmDecsr}) . {clear_alarm, AlarmId} : This event is generated by alarm_handler:clear_alarm(AlarmId) . The default simple handler is called alarm_handler and it may be exchanged by calling gen_event:swap_handler/3 as gen_event:swap_han- dler(alarm_handler, {alarm_handler, swap}, {NewHandler, Args}) . NewHandler:init({Args, {alarm_handler, Alarms}}) is called. Refer to gen_event(3erl) for further details. EXPORTS
clear_alarm(AlarmId) -> void() Types AlarmId = term() Clears all alarms with id AlarmId . get_alarms() -> [alarm()] Returns a list of all active alarms. This function can only be used when the simple handler is installed. set_alarm(alarm()) Types alarm() = {AlarmId, AlarmDescription} AlarmId = term() AlarmDescription = term() Sets an alarm with id AlarmId . This id is used at a later stage when the alarm is cleared. SEE ALSO
error_logger(3erl), gen_event(3erl) Ericsson AB sasl 2.1.9.3 alarm_handler(3erl)
Man Page