I have read many articles eg ultimate guide to logging and email notifications about errors But I am not sure whats the best way to log errors(specifically needed with errors only) along with user and params data(if user logged in of course). Any help/guide/workaround is really appreciated
When logging errors I usually use a tool, like Graylog to help me aggregate and better visualize what is happening. It can also notify you via Slack or e-mail, which helps a lot.
As for errors themselves I usually log the input that cause the error and I print it with the error itself. It helps to know what causes errors most of the time.
With Elixir you have Logger which is the default Logger, but you can use different backends and even make your own.
Hope it helps!