propper logging

This commit is contained in:
A.Unger
2020-02-12 13:28:41 +01:00
parent 8f43899476
commit ba8e60a714
5 changed files with 9 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ import (
"github.com/oklog/run"
"github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-accounts/pkg/micro/grpc"
olog "github.com/owncloud/ocis-pkg/v2/log"
)
// Server is the entry point for the server command.
@@ -62,9 +63,13 @@ func Server(cfg *config.Config) *cli.Command {
Action: func(c *cli.Context) error {
gr := run.Group{}
ctx, cancel := context.WithCancel(context.Background())
l := olog.NewLogger(
olog.Name(cfg.Server.Name),
)
defer cancel()
service := grpc.NewService(
grpc.Logger(l),
grpc.Context(ctx),
grpc.Config(cfg),
grpc.Name(cfg.Server.Name),