View Source ErrorTracker.Web (ErrorTracker v0.1.1)
ErrorTracker includes a dashboard to view and inspect errors that occurred on your application and are already stored in the database.
In order to use it, you need to add the following to your Phoenix's
router.ex
file:
defmodule YourAppWeb.Router do
use Phoenix.Router
use ErrorTracker.Web, :router
...
error_tracker_dashboard "/errors"
end
This will add the routes needed for ErrorTracker's dashboard to work.
Security considerations
Errors may contain sensitive information, like IP addresses, users information or even passwords sent on forms!
Securing your dashboard is an important part of integrating ErrorTracker on your project.
In order to do so, we recommend implementing your own security mechanisms in
the form of a mount hook and pass it to the error_tracker_dashboard
macro
using the on_mount
option.
You can find more details on
ErrorTracker.Web.Router.error_tracker_dashboard/2
.
LiveView socket options
By default the library expects you to have your LiveView socket at /live
and
using websocket
transport.
If that's not the case, you can configure it adding the following configuration to your app's config files:
config :error_tracker,
socket: [
path: "/my-custom-socket-path"
transport: :longpoll # (accepted values are :longpoll or :websocket)
]