Maxwell middleware for logging outgoing requests to Timer.io.
Using this middleware will automatically log all outgoing requests made with maxwell to Timber.io using the correct Timber Events.
Add maxwell_timber
to your list of dependencies in mix.exs
:
def deps do
[{:maxwell_timber, "~> 0.5"}]
end
defmodule MyClient do
use Maxwell.Builder, ~w(get)a
middleware MaxwellTimber.Middleware
def my_request_with_timber_logging(path) do
path
|> new()
|> get()
end
end
You can pass in an optional service_name
to this middleware to tag all
outgoing http requests with the given name. This will be searchable in
Timber.io's dashboard.
middleware MaxwellTimber.Middleware, [service_name: "my_service"]