appsignal / appsignal-elixir

🟪 AppSignal for Elixir package
https://www.appsignal.com/elixir
MIT License
282 stars 81 forks source link

Adding logger backend does not seem to send logs as expected #833

Closed wkirschbaum closed 1 year ago

wkirschbaum commented 1 year ago

Setting up the logger backend by adding this to MyApp.Application ( start/2 ):

Logger.add_backend({Appsignal.Logger.Backend, "phoenix"})

then calling:

    Appsignal.Logger.info("phoenix", "this works")
    Logger.info("but this does not work")

Only logs "but this does not work" to another backend, and "this works" to appsignal, but not "but this does not work" to appsignal.

To Reproduce

elixir 1.4.3 appsignal_phoenix 2.6.0 phoenix 1.7.2

shairyar commented 1 year ago

https://app.intercom.com/a/inbox/yzor8gyw/inbox/admin/4356044/conversation/16410700203283 (private link)

wkirschbaum commented 1 year ago

@shairyar I assume that link is not for me. If you need additional information please ask. We have other backend loggers which worked the same without issue, so either my understanding of how we should do the integration is wrong or there is a bug... which might help future people integrating.

shairyar commented 1 year ago

Ya, that's just for internal purposes. We will be taking a look into this and post an update here.

jeffkreeftmeijer commented 1 year ago

Hey @wkirschbaum,

Thanks for reaching out. We’ve updated the API for the logger backend slightly before release. Could you update your logger backend setup to the following, and see if that fixes your issues?:

Logger.add_backend({Appsignal.Logger.Backend, [group: "phoenix"]})

Also, I believe I’ve updated the documentation everywhere, but please let me know if you found documentation on this with the old syntax.

wkirschbaum commented 1 year ago

@jeffkreeftmeijer thanks, it works as expected now. Thanks.