summaryrefslogtreecommitdiff
path: root/plugins/http/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/http/plugin.go')
-rw-r--r--plugins/http/plugin.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index 51142ddd..aae42891 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -108,9 +108,20 @@ func (s *Plugin) Init(cfg config.Configurer, log log.Logger, server factory.Serv
}
s.pool = p
+ s.AddListener(s.logCallback)
+
return nil
}
+func (s *Plugin) logCallback(event interface{}) {
+ switch ev := event.(type) {
+ case ResponseEvent:
+ s.log.Info("response received", "elapsed", ev.Elapsed().String(), "remote address", ev.Request.RemoteAddr)
+ default:
+ fmt.Println(event)
+ }
+}
+
// Serve serves the svc.
func (s *Plugin) Serve() chan error {
s.Lock()