diff --git a/provisioning.go b/provisioning.go index ae995c93..aff6cf22 100644 --- a/provisioning.go +++ b/provisioning.go @@ -30,8 +30,10 @@ import ( "sync" "time" + "github.com/beeper/libserv/pkg/requestlog" "github.com/gorilla/mux" "github.com/rs/zerolog" + "github.com/rs/zerolog/hlog" "maunium.net/go/mautrix/id" "go.mau.fi/mautrix-signal/pkg/signalmeow" @@ -53,10 +55,12 @@ type ProvisioningAPI struct { } func (prov *ProvisioningAPI) Init() { - prov.log.Debug().Msgf("Enabling provisioning API at %v", prov.bridge.Config.Bridge.Provisioning.Prefix) + prov.log.Debug().Str("prefix", prov.bridge.Config.Bridge.Provisioning.Prefix).Msg("Enabling provisioning API") prov.provisioningUsers = make(map[string]int) prov.provisioningMutexes = make(map[string]*sync.Mutex) r := prov.bridge.AS.Router.PathPrefix(prov.bridge.Config.Bridge.Provisioning.Prefix).Subrouter() + r.Use(hlog.NewHandler(prov.log)) + r.Use(requestlog.AccessLogger(true)) r.Use(prov.AuthMiddleware) r.HandleFunc("/v2/link/new", prov.LinkNew).Methods(http.MethodPost) r.HandleFunc("/v2/link/wait/scan", prov.LinkWaitForScan).Methods(http.MethodPost)