mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-20 03:27:02 -07:00
fix: changed more output to use log instead of fmt
This commit is contained in:
parent
e1a9f4ae36
commit
40c8564681
1 changed files with 5 additions and 6 deletions
|
|
@ -19,7 +19,6 @@ import (
|
||||||
"github.com/go-chi/chi/v5"
|
"github.com/go-chi/chi/v5"
|
||||||
"github.com/go-chi/chi/v5/middleware"
|
"github.com/go-chi/chi/v5/middleware"
|
||||||
"github.com/rs/zerolog"
|
"github.com/rs/zerolog"
|
||||||
"github.com/sirupsen/logrus"
|
|
||||||
|
|
||||||
openchami_authenticator "github.com/openchami/chi-middleware/auth"
|
openchami_authenticator "github.com/openchami/chi-middleware/auth"
|
||||||
openchami_logger "github.com/openchami/chi-middleware/log"
|
openchami_logger "github.com/openchami/chi-middleware/log"
|
||||||
|
|
@ -71,6 +70,10 @@ func New(conf *config.Config) *Server {
|
||||||
|
|
||||||
// Main function to start up configurator as a service.
|
// Main function to start up configurator as a service.
|
||||||
func (s *Server) Serve() error {
|
func (s *Server) Serve() error {
|
||||||
|
// Setup logger
|
||||||
|
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||||
|
logger := log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
||||||
|
|
||||||
// set the server address with config values
|
// set the server address with config values
|
||||||
s.Server.Addr = s.Config.Server.Host
|
s.Server.Addr = s.Config.Server.Host
|
||||||
|
|
||||||
|
|
@ -80,17 +83,13 @@ func (s *Server) Serve() error {
|
||||||
var err error
|
var err error
|
||||||
tokenAuth, err = configurator.FetchPublicKeyFromURL(s.Config.Server.Jwks.Uri)
|
tokenAuth, err = configurator.FetchPublicKeyFromURL(s.Config.Server.Jwks.Uri)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorf("failed to fetch JWKS: %v", err)
|
log.Error().Err(err).Msgf("failed to fetch JWKS")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup logger
|
|
||||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
|
||||||
logger := log.Output(zerolog.ConsoleWriter{Out: os.Stderr})
|
|
||||||
|
|
||||||
// create client with opts to use to fetch data from SMD
|
// create client with opts to use to fetch data from SMD
|
||||||
opts := []client.Option{
|
opts := []client.Option{
|
||||||
client.WithAccessToken(s.Config.AccessToken),
|
client.WithAccessToken(s.Config.AccessToken),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue