erlyaws / yaws

Yaws webserver
https://erlyaws.github.io
BSD 3-Clause "New" or "Revised" License
1.28k stars 267 forks source link

report.log no longer captures all logs #366

Open leoliu opened 5 years ago

leoliu commented 5 years ago

Before OTP 21, error_logger is the only logger provided by default and used by OTP. The result is when Yaws report.log is enabled (default) most logs are captured.

The situation changed since OTP 21. error_logger is now the legacy logger and captures only logs produced by error_logger. Most of OTP has migrated to the new logger. As times goes by so will more and more 3rd party apps while error_logger is being phased out. As a result report.log is becoming less useful capturing a shrinking subset of logs.

I have to disable report.log on OTP 21 and use logger so that no logs go unnoticed.

vinoski commented 5 years ago

@leoliu can you provide an example of information that in older Erlang/OTP versions would make it into report.log but is no longer there with version 21 or newer? I'm trying to figure out how to tackle this issue, and more details would be helpful. Thanks in advance.

leoliu commented 5 years ago

If an application uses logger to produce logs, those won't be written to report.log. For example,

logger:error([{error, this_is_a_test}]).

In older OTP where there was no logger, the above log is likely written as

error_logger:error_report([{error, this_is_a_test}]).
vinoski commented 5 years ago

OK, thanks. I just wanted to be sure it wasn't more complicated than this.