Skip to content

Commit

Permalink
fix: logging when the server is running [PLT-58] (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsalles authored Dec 6, 2021
1 parent 6d51ed6 commit d5cb31c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/common/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func NewServer(logger logging.Logger, configuration HTTPServerConfiguration) *Se
// Run when called starts the server
func (s *Server) Run(ctx context.Context) {
go func() {
s.logger.Infof("Server Running on [%v:%v]", s.configuration.Host, s.configuration.Port)
if err := s.httpServer.ListenAndServe(); err != http.ErrServerClosed {
s.logger.Errorf("unexpected error while running server %v", err)
}
Expand All @@ -69,6 +70,7 @@ func (s *Server) Run(ctx context.Context) {
// RunSecurely when called starts the https server
func (s *Server) RunSecurely(ctx context.Context) {
go func() {
s.logger.Infof("Server Running on [%v:%v]", s.configuration.Host, s.configuration.Port)
if err := s.httpServer.ListenAndServeTLS(s.configuration.CertificateFile, s.configuration.CertificateKeyFile); err != http.ErrServerClosed {
s.logger.Errorf("unexpected error while running server %v", err.Error())
}
Expand Down

0 comments on commit d5cb31c

Please sign in to comment.