Skip to content

Commit

Permalink
instantiate new logger for 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 7e508e1 commit 429f52f
Show file tree
Hide file tree
Showing 134 changed files with 75,159 additions and 4 deletions.
5 changes: 2 additions & 3 deletions exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ import (
"golang.org/x/sys/windows/svc"

"github.com/StackExchange/wmi"
gokitLogrus "github.com/go-kit/kit/log/logrus"
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"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/version"
"github.com/prometheus/exporter-toolkit/https"
"github.com/sirupsen/logrus"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand Down Expand Up @@ -406,7 +405,7 @@ func main() {
go func() {
log.Infoln("Starting server on", *listenAddress)
server := &http.Server{Addr: *listenAddress}
if err := https.Listen(server, *httpsConfig, gokitLogrus.NewLogrusLogger(log.Base().(logrus.FieldLogger))); err != nil {
if err := https.Listen(server, *httpsConfig, gokitLog.NewLogfmtLogger(os.Stdout)); err != nil {
log.Fatalf("cannot start windows_exporter: %s", err)
}
}()
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ require (
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.15.0
github.com/prometheus/exporter-toolkit v0.4.0
github.com/sirupsen/logrus v1.6.0
golang.org/x/sys v0.0.0-20201015000850-e3ed0017c211
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gopkg.in/alecthomas/kingpin.v2 v2.2.6
Expand Down
22 changes: 22 additions & 0 deletions vendor/github.com/go-kit/kit/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

151 changes: 151 additions & 0 deletions vendor/github.com/go-kit/kit/log/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

116 changes: 116 additions & 0 deletions vendor/github.com/go-kit/kit/log/doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 429f52f

Please sign in to comment.