Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERL-1197: How does one create a logger handler with overload protection? #3914

Open
OTP-Maintainer opened this issue Mar 18, 2020 · 1 comment
Labels
priority:low team:VM Assigned to OTP team VM

Comments

@OTP-Maintainer
Copy link

Original reporter: bucko909
Affected version: Not Specified
Component: Not Specified
Migrated from: https://bugs.erlang.org/browse/ERL-1197


I've been trying to make a new handler to submit log entries to Sentry (a la raven) using the new {{logger}} API. I'm struck by a few things:
 * The new features such as overload protection rely on implementing callbacks for an undocumented behaviour ({{logger_h_common}}).
 * Logger specifies certain helpers for formatters, but the handler is responsible for calling them.
 * The formatter isn't actually used at all for OTP messages, even in the default loggers.
 * Using {{error_logger}} doesn't get the overload protection features, as it doesn't actually use {{logger_h_common}}.

I think I've just about cobbled together something that works, but I think it'd be great if this module could "come out of the woodwork" and be a real tool to aid developers in development of logger handlers – especially as I'm going to be using an undocumented API!

(Overload protection is necessary in this case because it's going to need to do HTTP requests for each message to a server than may be poorly. I'm reluctant to use {{httpc}} because it doesn't document its {{\{sync, true\}}} behaviour – I don't want to bother any other users of that module, not allow unbounded parallelism!)
@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug team:VM Assigned to OTP team VM priority:low labels Feb 10, 2021
@garazdawi garazdawi removed the bug Issue is reported as a bug label Apr 6, 2022
@garazdawi
Copy link
Contributor

Related to #4050

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:low team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants