Skip to content

Commit 9caa890

Browse files
committed
[apricot] Improve log output
1 parent 51b69c6 commit 9caa890

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

apricot/apricot.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ func Run() (err error) {
5454
Infof("AliECS Configuration Service running with verbose logging")
5555
}
5656

57-
5857
s := remote.NewServer(Instance())
5958
httpsvr := local.NewHttpService(instance)
6059
signals(s, httpsvr) // handle UNIX signals
60+
6161
var lis net.Listener
6262
lis, err = net.Listen("tcp", fmt.Sprintf(":%d", viper.GetInt("listenPort")))
6363
if err != nil {
@@ -69,7 +69,7 @@ func Run() (err error) {
6969

7070
log.WithField("port", viper.GetInt("listenPort")).
7171
WithField("level", infologger.IL_Support).
72-
Info("service started")
72+
Info("gRPC service started")
7373
if err = s.Serve(lis); err != nil {
7474
log.WithField("error", err).Fatal("gRPC server failed to serve")
7575
}

apricot/local/servicehttp.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636

3737
_ "github.com/AliceO2Group/Control/apricot/docs"
3838
apricotpb "github.com/AliceO2Group/Control/apricot/protos"
39+
"github.com/AliceO2Group/Control/common/logger/infologger"
3940
"github.com/AliceO2Group/Control/common/system"
4041
"github.com/AliceO2Group/Control/configuration"
4142
"github.com/AliceO2Group/Control/configuration/componentcfg"
@@ -123,6 +124,10 @@ func NewHttpService(service configuration.Service) (svr *http.Server) {
123124

124125
// async-start of http Service and capture error
125126
go func() {
127+
log.WithField("port", viper.GetInt("httpListenPort")).
128+
WithField("level", infologger.IL_Support).
129+
Info("HTTP service started")
130+
126131
err := httpsvr.ListenAndServe()
127132
if err != nil {
128133
log.WithError(err).Error("HTTP service returned error")
@@ -199,6 +204,8 @@ func (httpsvc *HttpService) ApiListComponents(w http.ResponseWriter, r *http.Req
199204
// @Success 200
200205
// @Router /components/_invalidate_cache [post]
201206
func (httpsvc *HttpService) ApiInvalidateCache(w http.ResponseWriter, r *http.Request) {
207+
log.WithField("level", infologger.IL_Support).
208+
Debug("invalidating component template cache")
202209
httpsvc.svc.InvalidateComponentTemplateCache()
203210
w.WriteHeader(http.StatusOK)
204211
_, _ = fmt.Fprintln(w, "OK")

0 commit comments

Comments
 (0)