Trim Logger output

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Trim Logger output

Frank Muller
Hi guys

Which config I should use to force Logger trim long lines of logs (ellided [...])?

Thanks in advance 
/Frank

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Trim Logger output

Siri Hansen
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 <[hidden email]>:
Hi guys

Which config I should use to force Logger trim long lines of logs (ellided [...])?

Thanks in advance 
/Frank
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Trim Logger output

Frank Muller
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 <[hidden email]>:
Hi guys

Which config I should use to force Logger trim long lines of logs (ellided [...])?

Thanks in advance 
/Frank
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Trim Logger output

Siri Hansen
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 <[hidden email]>:
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 <[hidden email]>:
Hi guys

Which config I should use to force Logger trim long lines of logs (ellided [...])?

Thanks in advance 
/Frank
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Trim Logger output

Frank Muller
depth 10 / chars_limit 1024 / max_size 2048 worked for me.

/Frank

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 <[hidden email]>:
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 <[hidden email]>:
Hi guys

Which config I should use to force Logger trim long lines of logs (ellided [...])?

Thanks in advance 
/Frank
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions