[erlang-questions] log4erl as system logger
Wed Jun 2 17:34:20 CEST 2010
On Jun 2, 2010, at 8:37 AM, Alessandro Sivieri wrote:
> For what I have seen, too, there is no way to replace the default logger
> with a different one (as in Java, for example); maybe we can suggest this
> modification to the OTP maintainers, or they can tell us if there is some
> reason in not allowing this.
I don't see why you couldn't just replace the error_logger module with a custom one. You'd just need to be sure it has the same API. Otherwise stuff will break in nasty ways, since the error_logger module is used by all sorts of system code.
As others have mentioned, another (better) alternative would be to replace the default handlers with custom ones. After all, error_logger is just a gen_event process, so this is quite easy to do and can change the logging behavior completely. You'd have to handle the default OTP protocol, but that's not such a big deal.
More information about the erlang-questions