[erlang-questions] R21 logger mangles map messages

Mark Geib mark.geib.44@REDACTED
Thu Aug 9 16:42:20 CEST 2018


Yes that removed the extra commas. Of course now the log messages are multi-line.

So to get a single line message for maps, without the commas, is the only approach to format the message with something like
io_lib:print(MyBigMap,1,8192,-1) and then log the string?

These log messages are being consumed by splunk, so the commas are causing problems, and the messages need to be single line.

Thanks,
Mark.


> On Aug 9, 2018, at 2:31 AM, Siri Hansen <erlangsiri@REDACTED> wrote:
> 
> It is probably the single_line property on the formatter that causes this. If single_line is true (default), then the formatted string is converted to a single line by replacing all newlines with ", " (comma, space). Could you please try to set single_line to false and let me see the output? The property can be set as follows (if the printout comes from the default handler):
> 
> logger:update_formatter_config(default,single_line,false).
> 
> Regards
> /siri
> 
> Den ons. 8. aug. 2018 kl. 23:01 skrev Mark Geib <mark.geib.44@REDACTED <mailto:mark.geib.44@REDACTED>>:
> I am migrating an application to R21 to try out the new logger. When I log a message with a map, using “~p”, it appears like:
> 
> #{pmt_pid =>, 33, program_number =>, 5837} <-----(notice the extra commas after each =>)
> 
> compared to io:format output of #{pmt_pid => 33, program_number => 5837}
> 
> In both cases my formatting is “~p”.
> 
> Has anyone seen this before.??
> 
> Thanks,
> 
> Mark.
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED <mailto:erlang-questions@REDACTED>
> http://erlang.org/mailman/listinfo/erlang-questions <http://erlang.org/mailman/listinfo/erlang-questions>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180809/91163196/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 528 bytes
Desc: Message signed with OpenPGP
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180809/91163196/attachment.bin>


More information about the erlang-questions mailing list