[erlang-questions] Extending error_logger

denis <>
Wed Aug 15 00:52:40 CEST 2007


Hi all,

In my server, which is an OTP application using supervisor, gen_servers, .,
I use error_logger to log my information.
I would like to modify error_logger to add one kind of message: debug, link
error, debug, info.
Is there a clean way to add it to error_logger ? I dug the source, but not
find an easy way.
For now, the only solution I found is to implement my own logger
implementing all I need, and trap the events sent to error_logger by OTP
framework. 
If I'm not mistaken, I can do it by writing my logger as event handler and
register it with error_logger: add_report_handler.
Am I one the good track ? Maybe there is a simpler method to do it ?

Note that I also want to store logs as text file. I think that write a new
error handler should do the job, like log_mf_h.

Thanks
Denis




More information about the erlang-questions mailing list