<div dir="ltr">Hi again, Mark!<div><br></div><div>I see that you set the handler level to debug in the sys.config, but I can't see that the primary level is set? Please refer to the Kernel User's Guide, <a href="http://erlang.org/doc/apps/kernel/logger_chapter.html">http://erlang.org/doc/apps/kernel/logger_chapter.html</a>, for a description of how primary level check and -filters are applied prior to all handler level checks and -filters. (short version: if a log event does not pass the primary level check, it is discarded and will never hit any handler).</div><div><br></div><div>Primary level is 'notice' by default, and handler levels are 'all' by default.</div><div><br></div><div>What I mean is that your sys.config should look something like this:<br></div><div><br></div><div><div><font face="monospace, monospace">{kernel,</font></div><div><font face="monospace, monospace">    [{logger,</font></div><div><font face="monospace, monospace">      [{handler, default, logger_std_h,</font></div><div><font face="monospace, monospace">       #{level => debug,</font></div><div><font face="monospace, monospace">         config => #{type => {file,"log/erlang.log"}},</font></div><div><font face="monospace, monospace">         formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}}</font></div><div><font face="monospace, monospace">      }]</font></div><div><span style="font-family:monospace,monospace">     },</span></div><div><font face="monospace, monospace">     {logger_level, all}</font></div><div><font face="monospace, monospace">    ]</font></div><div><font face="monospace, monospace">}</font></div></div></div><br><div class="gmail_quote"><div dir="ltr">Den man. 9. jul. 2018 kl. 19:22 skrev Mark Geib <<a href="mailto:mark.geib.44@gmail.com">mark.geib.44@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">So after some more debugging, it appears that if I use “debug” or “info” in either the sys.config logger config for the logging level, or as the level of log message I see nothing. If I use any of the other levels it appears to work as expected. All the combinations I tried worked as well, i.e. if I set the log level in the config to “notice” and then log with logger:emergency(), it works fine.<div><br></div><div>Mark.<br><div><br><blockquote type="cite"><div>On Jul 9, 2018, at 1:33 AM, Siri Hansen <<a href="mailto:erlangsiri@gmail.com" target="_blank">erlangsiri@gmail.com</a>> wrote:</div><br class="m_-1330995996136949013Apple-interchange-newline"><div><div dir="ltr">Hi Mark, you just missed that the primary log level by default is 'notice', which means that 'info' is rejected by the primary log level check. If you do logger:notice("test message") instead, it should be printed. To even print 'info', set the kernel configuration parameter logger_level to 'info', 'debug' or 'all' in your sys config, or set it in runtime with logger:set_primary_config(level,Level).<div><br></div><div>Regards</div><div>/siri</div></div><br><div class="gmail_quote"><div dir="ltr">Den fre. 6. jul. 2018 kl. 20:44 skrev Mark Geib <<a href="mailto:mark.geib.44@gmail.com" target="_blank">mark.geib.44@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">I decided to take a look at the new logger in R21, but I am not able to produce any output.<div><br></div><div>In my sys.config I have the following:</div><div><font face="Andale Mono">{kernel,<br>    [{logger,<br>      [{handler, default, logger_std_h,<br>       #{level => debug,<br>         config => #{type => {file,"log/erlang.log"}},<br>         formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}}<br>      }]<br>    }]<br> }</font></div><div><font face="Andale Mono"><br></font></div><div>And in my code I do something like <font face="Andale Mono">logger:info(“test message”)</font>, but I never see any output to the file. I see the file log/erlang.log created, but always empty.</div><div><br></div><div>I must be missing something, but I have read through the docs, quickly.</div><div><br></div><div>Any pointers would be appreciated.</div><div><br></div><div>Mark.</div></div>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div>