Skip to content

Commit

Permalink
initialize new logger for http server
Browse files Browse the repository at this point in the history
Signed-off-by: replay <[email protected]>
  • Loading branch information
replay committed Jan 28, 2021
1 parent d59975d commit fea9d06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"golang.org/x/sys/windows/svc"

"github.com/StackExchange/wmi"
gokitLog "github.com/go-kit/kit/log"
"github.com/prometheus-community/windows_exporter/collector"
"github.com/prometheus-community/windows_exporter/config"
"github.com/prometheus/client_golang/prometheus"
Expand Down Expand Up @@ -404,8 +405,8 @@ func main() {
go func() {
log.Infoln("Starting server on", *listenAddress)
server := &http.Server{Addr: *listenAddress}
if err := https.Listen(server, *httpsConfig, logger); err != nil {
log.Fatalf("cannot start windows_exporter: %s", err)
if err := https.Listen(server, *httpsConfig, gokitLog.NewLogfmtLogger(os.Stdout)); err != nil {
log.Fatalf("cannot start windows_exporter: %s", err)
}
}()

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/Microsoft/hcsshim v0.8.6
github.com/StackExchange/wmi v0.0.0-20180725035823-b12b22c5341f
github.com/dimchansky/utfbom v1.1.0
github.com/go-kit/kit v0.10.0
github.com/go-ole/go-ole v1.2.1 // indirect
github.com/google/go-cmp v0.5.1 // indirect
github.com/leoluk/perflib_exporter v0.1.0
Expand Down

0 comments on commit fea9d06

Please sign in to comment.