gelf_logger icon indicating copy to clipboard operation
gelf_logger copied to clipboard

cannot produce logs when rpc-ing into a elixir release

Open flavius-gemini opened this issue 5 years ago • 2 comments

When u use rpc to connect to a running elixir process and then execute any action that would cause a log to be sent to gelf, the messages are not sent. Steps to reproduce 1.Build a long living app called hello_world. Say a api based on phoenix. 2.mix release. 3.start your app with /bin/hello_world daemon (or start) 4.from another console, you go /bin hello_world rpc "require Logger; Logger.info("flavius was here")" Expected result flavius was here is logged to gelf Actual result flavius was here is not logged to gelf

The fix is easy and it is suggested at the end of this thread. https://elixirforum.com/t/logging-from-within-remote-session/26323/5

Mainly just delete the handle_event at line 71.

flavius-gemini avatar Feb 07 '20 22:02 flavius-gemini

Sorry for the very slow response. What the code is doing currently is in line with what is recommended in https://hexdocs.pm/logger/Logger.html#module-custom-backends

I'm trying to dig in and find why that is recommended.

jschniper avatar Jul 22 '20 20:07 jschniper

Looks as though removing it can create up some situations where events are double logged but I need to play around with it some more in order to tell if it's something that would ever happen in normal usage.

jschniper avatar Jul 22 '20 21:07 jschniper