[erlang-questions] Trim Logger output

Siri Hansen erlangsiri@REDACTED
Thu Mar 14 16:13:43 CET 2019


Since logger is so new, I don't know about any real use examples, but
since chars_limit
specifically tries to reduce the number of characters to the given number
I'd set it to the actual size (or possibly a bit smaller) that you allow. If
the size is absolute, then I'd use max_size in addition to do the hard
truncation.

If you'd rather use depth, the outcome is a bit harder to predict, but I
found this guideline in some old documentation:
"A reasonable starting value for Depth is 30. We recommend to test crashing
various processes in your application, examine the logs from the crashes,
and then increase or decrease the value."

/siri


Den tor. 14. mar. 2019 kl. 13:50 skrev Frank Muller <
frank.muller.erl@REDACTED>:

> Hi Siri
>
> Exactly what I want. Any real example usage with good default settings
> please?
>
> I want to trim my strings to 1KB.
>
> /Frank
>
> Hi Frank,
>>
>> The default formatter, logger_formatter, has three configuration
>> parameters for this purpose: depth, chars_limit, and max_size. depth and
>> chars_limit are soft limits that work on format strings, and max_size is a
>> hard truncation limit. See
>> http://erlang.org/doc/man/logger_formatter.html for more details.
>>
>> Regards
>> /siri
>>
>> Den tor. 14. mar. 2019 kl. 12:39 skrev Frank Muller <
>> frank.muller.erl@REDACTED>:
>>
>>> Hi guys
>>>
>>> Which config I should use to force Logger trim long lines of logs
>>> (ellided [...])?
>>>
>>> Thanks in advance
>>> /Frank
>>>
>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190314/2ddbac88/attachment.htm>


More information about the erlang-questions mailing list