summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--service/container.go3
-rw-r--r--service/container_test.go2
2 files changed, 5 insertions, 0 deletions
diff --git a/service/container.go b/service/container.go
index 88d9ef41..bf712092 100644
--- a/service/container.go
+++ b/service/container.go
@@ -151,11 +151,13 @@ func (c *container) Serve() error {
continue
}
+ c.log.Debugf("%s.service: started", e.name)
go func(e *entry) {
e.setStatus(StatusServing)
defer e.setStatus(StatusStopped)
if err := e.svc.Serve(); err != nil {
+ c.log.Errorf("%s.service: %s", e.name, err)
done <- errors.Wrap(err, fmt.Sprintf("%s.service", e.name))
}
}(e)
@@ -184,6 +186,7 @@ func (c *container) Stop() {
if e.hasStatus(StatusServing) {
e.svc.Stop()
e.setStatus(StatusStopped)
+ c.log.Debugf("%s.service: stopped", e.name)
}
}
}
diff --git a/service/container_test.go b/service/container_test.go
index 69d67441..5278efe7 100644
--- a/service/container_test.go
+++ b/service/container_test.go
@@ -309,4 +309,6 @@ func TestContainer_ServeErrorMultiple(t *testing.T) {
s, st = c.Get("test2")
assert.IsType(t, &testService{}, s)
assert.Equal(t, StatusStopped, st)
+
+ assert.Equal(t, 6, len(hook.Entries))
}