Skip to content

Commit

Permalink
Add http server error logger
Browse files Browse the repository at this point in the history
  • Loading branch information
desa committed May 24, 2017
1 parent 7e27fd0 commit 15b4db9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions services/httpd/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ type Service struct {

Handler *Handler

logger *log.Logger
logger *log.Logger
httpServerLogger *log.Logger
}

func NewService(c Config, hostname string, l *log.Logger, li logging.Interface) *Service {
Expand Down Expand Up @@ -68,7 +69,8 @@ func NewService(c Config, hostname string, l *log.Logger, li logging.Interface)
li,
c.SharedSecret,
),
logger: l,
logger: l,
httpServerLogger: li.NewStaticLevelLogger("[go-http]", log.LstdFlags, logging.ERROR),
}
return s
}
Expand Down Expand Up @@ -110,6 +112,7 @@ func (s *Service) Open() error {
s.server = &http.Server{
Handler: s.Handler,
ConnState: s.connStateHandler,
ErrorLog: s.httpServerLogger,
}

s.new = make(chan net.Conn)
Expand Down

0 comments on commit 15b4db9

Please sign in to comment.