Skip to content

Commit

Permalink
Merge pull request #30 from githubsands/log_specified_headers
Browse files Browse the repository at this point in the history
petasos: log specified headers .
  • Loading branch information
johnabass authored Oct 16, 2018
2 parents 0af2a05 + 719fce3 commit 106d933
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions petasos.spec
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,5 @@ if [ $1 = 0 ]; then
fi

%changelog
* Tue Mar 28 2017 Weston Schmidt - 0.1.1
- initial creation
8 changes: 7 additions & 1 deletion src/petasos/petasos.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@ import (
"github.com/Comcast/webpa-common/concurrent"
"github.com/Comcast/webpa-common/device"
"github.com/Comcast/webpa-common/logging"
"github.com/Comcast/webpa-common/logging/logginghttp"
"github.com/Comcast/webpa-common/server"
"github.com/Comcast/webpa-common/service"
"github.com/Comcast/webpa-common/service/monitor"
"github.com/Comcast/webpa-common/service/servicecfg"
"github.com/Comcast/webpa-common/service/servicehttp"
"github.com/Comcast/webpa-common/xhttp/xcontext"
"github.com/go-kit/kit/log/level"
"github.com/justinas/alice"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
Expand Down Expand Up @@ -87,7 +90,10 @@ func petasos(arguments []string) int {
RedirectCode: http.StatusTemporaryRedirect,
}

_, petasosServer, done = webPA.Prepare(logger, nil, metricsRegistry, redirectHandler)
requestFunc = logginghttp.SetLogger(redirectHandler.Logger, logginghttp.Header("X-Webpa-Device-Name", "device_id"), logginghttp.Header("Authorization", "authorization"))
decoratedHandler = alice.New(xcontext.Populate(0, requestFunc)).Then(redirectHandler)

_, petasosServer, done = webPA.Prepare(logger, nil, metricsRegistry, decoratedHandler)
signals = make(chan os.Signal, 1)
)

Expand Down

0 comments on commit 106d933

Please sign in to comment.