I’m using lager to log to file from my Elixir release (I need the log rotation that lager provides). Some error messages are printing unhelpfully though:
2020-11-02 17:27:19.740 [warning] <0.865.0> Unexpected error_logger event {error_msg,<0.879.0>,{<0.884.0>,[42,42,32,84,97,115,107,32,126,112,32,116,101,114,109,105,110,97,116,105,110,103,126,110,42,42,32,83,116,97,114,116,101,100,32,102,114,111,109,32,126,112,126,110,42,42,32,87,104,101,110,32,102,117,110,99,116,105,111,110,32,32,61,61,32,126,112,126,110,42,42,32,32,32,32,32,32,97,114,103,117,109,101,110,116,115,32,61,61,32,126,112,126,110,42,42,32,82,101,97,115,111,110,32,102,111,114,32,116,101,114,109,105,110,97,116,105,111,110,32,61,61,32,126,110,42,42,32,126,112,126,110],[<0.884.0>,<0.882.0>,#Fun<Elixir.NetCmds.Supervisor.0.118374414>,[],{{badmatch,{error,badarg}},[{'Elixir.NetCmds.Server',loop_acceptor,1,[{file,[108,105,98,47,110,101,116,95,99,109,100,115,47,115,101,114,118,101,114,46,101,120]},{line,24}]},{'Elixir.Task.Supervised',invoke_mfa,2,[{file,[108,105,98,47,116,97,115,107,47,115,117,112,101,114,118,105,115,101,100,46,101,120]},{line,90}]},{proc_lib,init_p_do_apply,3,[{file,[112,114,111,99,95,108,105,98,46,101,114,108]},{line,249}]}]}]}}
2020-11-02 17:27:19.740 [info] <0.1645.0>@Elixir.NetCmds.Server:accept/1:17 Accepting connections on port 3900
2020-11-02 17:27:19.744 [error] <0.884.0>@Elixir.NetCmds.Server:loop_acceptor:24 CRASH REPORT Process <0.884.0> with 0 neighbours crashed with reason: no match of right hand value {error,badarg} in 'Elixir.NetCmds.Server':loop_acceptor/1 line 24
2020-11-02 17:27:19.748 [error] <0.882.0>@Elixir.NetCmds.Server:loop_acceptor:24 Supervisor {<0.882.0>,'Elixir.NetCmds.Supervisor'} had child 'Elixir.Task' started with 'Elixir.Task':start_link(#Fun<Elixir.NetCmds.Supervisor.0.118374414>) at <0.884.0> exit with reason no match of right hand value {error,badarg} in 'Elixir.NetCmds.Server':loop_acceptor/1 line 24 in context child_terminated
(the first line is the problematic one, I put the others in for context)
Those lists are clearly erlang charlists (you can put them in iex and get a string printed). I’m not clear on how the various pieces of logging interact - Elixir logger, erlang logger and Lager. I presume this is an incompatibility between a couple of them?