[erlang-questions] error_logger heap overflow

Andrew Thompson andrew@REDACTED
Wed Nov 28 07:47:46 CET 2012

On Tue, Nov 20, 2012 at 03:28:57AM -0800, Bogdan Andu wrote:
> I used that, lager, but it is hard to read error messages, and the errors are duplicated across all log files.
> One cannot say to lager: commit notice messages to /var/log/notice_log, because all error messages with higher prority get written there, too.

I decided to tinker around this week in relation to this issue and came
up with this:


Does that address your concern on that front?

> I like how error_logger prints the errors and I am used to it.
> Please give me an advice of how to overcome this situation.

One thing you could do would be to fork the stdlib (or SASL)
error_logger gen_event handlers to use lager_format instead of io_lib
(lager_format is a fork of io_lib with size based truncation added to
avoid the OOM issues). The only downside to this is that lager_format
currently lacks the line-wrapping support ~p and friends have in io_lib,
so stacktraces, for example, end up on one big line rather than being
line wrapped nicely.

Also, with regard to lager and formatting OTP errors, lager will try to
rewrite common OTP errors into more 'friendly' log messages, but it will
also write a truncated version of the original log format to the
'crash.log', if more information is required.

Finally, if you could give me more information on what makes lager's
messages 'hard to read', I'd appreciate it. Maybe some improvements can
be made.

Hope that helps,


More information about the erlang-questions mailing list