Skip to content

Commit

Permalink
minor edit server logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Utkarsh Shukla committed Dec 9, 2024
1 parent f468b63 commit 318705d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions internal/serviceconfig/service_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func RunHTTPSServer(ctx context.Context, em EchoManager, routes Destinations, tl
// incoming requests to the hard-coded configured destination.
func RunHTTPServer(ctx context.Context, em EchoManager, routes Destinations, service IncomingServiceConfig) {
logger := logging.WithContext(ctx).Sugar()
logger.Infow("Running service HTTP listener on port %d", service.Port)
logger.Infow("Running service HTTP listener on port", service.Port)

mux := http.NewServeMux()

Expand All @@ -94,10 +94,10 @@ func RunHTTPServer(ctx context.Context, em EchoManager, routes Destinations, ser
Addr: fmt.Sprintf(":%d", service.Port),
Handler: mux,
}
logger.Infow("Server:", server)
// logger.Infow("Server:", server)

addDefaults(ctx, server)
logger.Infow("Server after defaults", server)
logger.Infow("Server after defaults")

logger.Infow("Started Listening with error", server.ListenAndServe())
}
Expand All @@ -116,9 +116,9 @@ func fixedIdentityAPIHandlerMaker(em EchoManager, routes Destinations, service I
ServiceType: service.ServiceType,
ServiceName: service.DestinationService,
}
logger.Infow("fixedIdentityAPIHandlerMaker with endpoint", ep)
logger.Infow("routes", routes)
logger.Infow("http request: ", r)
logger.Infow("fixedIdentityAPIHandlerMaker with endpoint", ep.ServiceName)
// logger.Infow("routes", routes)
logger.Infow("http request: ", r.Body)
runAPIHandler(em, routes, ep, w, r)
}
}
Expand Down Expand Up @@ -188,9 +188,9 @@ func secureAPIHandlerMaker(em EchoManager, routes Destinations, service Incoming
func runAPIHandler(em EchoManager, routes Destinations, ep SearchSpec, w http.ResponseWriter, r *http.Request) {
ctx := logging.NewContext(r.Context())
logger := logging.WithContext(ctx).Sugar()
logger.Infow("New request context: ", r.Context())
logger.Infow("New request context")
session := routes.Search(ctx, ep)
logger.Infow("Session: ", session)
logger.Infow("Session")
if session == nil {
logger.Infow("no such destination for service request", "destination", ep.Destination, "serviceName", ep.ServiceName, "serviceType", ep.ServiceType)
w.WriteHeader(http.StatusBadGateway)
Expand All @@ -208,7 +208,7 @@ func runAPIHandler(em EchoManager, routes Destinations, ep SearchSpec, w http.Re

streamID := ulid.GlobalContext.Ulid()
echo := em.MakeRequester(ctx, ep, streamID)
logger.Infow("Run requester made", echo)
// logger.Infow("Run requester made", echo)
defer echo.Shutdown(ctx)
echo.RunRequest(ctx, session, body, w, r)
}

0 comments on commit 318705d

Please sign in to comment.