2016-07-25 20:00:28 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2017-03-08 18:33:19 +00:00
|
|
|
"context"
|
2016-11-02 21:07:05 +00:00
|
|
|
"crypto/tls"
|
|
|
|
"crypto/x509"
|
2016-07-25 20:00:28 +00:00
|
|
|
"errors"
|
|
|
|
"fmt"
|
|
|
|
"io/ioutil"
|
2016-10-04 07:27:50 +00:00
|
|
|
"net"
|
2016-07-25 20:00:28 +00:00
|
|
|
"net/http"
|
2016-11-22 23:35:46 +00:00
|
|
|
"os"
|
|
|
|
"strings"
|
2016-11-03 00:52:49 +00:00
|
|
|
"time"
|
2016-07-25 20:00:28 +00:00
|
|
|
|
2016-11-03 21:32:23 +00:00
|
|
|
"github.com/ghodss/yaml"
|
2017-12-20 15:03:32 +00:00
|
|
|
grpcprometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
|
|
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
|
|
"github.com/prometheus/client_golang/prometheus/promhttp"
|
2017-07-25 20:45:17 +00:00
|
|
|
"github.com/sirupsen/logrus"
|
2016-08-05 16:50:22 +00:00
|
|
|
"github.com/spf13/cobra"
|
2016-10-04 07:27:50 +00:00
|
|
|
"google.golang.org/grpc"
|
|
|
|
"google.golang.org/grpc/credentials"
|
2019-08-06 20:56:09 +00:00
|
|
|
"google.golang.org/grpc/reflection"
|
2016-07-25 20:00:28 +00:00
|
|
|
|
2018-09-03 06:44:44 +00:00
|
|
|
"github.com/dexidp/dex/api"
|
2019-02-22 12:19:23 +00:00
|
|
|
"github.com/dexidp/dex/pkg/log"
|
2018-09-03 06:44:44 +00:00
|
|
|
"github.com/dexidp/dex/server"
|
|
|
|
"github.com/dexidp/dex/storage"
|
2016-07-25 20:00:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func commandServe() *cobra.Command {
|
|
|
|
return &cobra.Command{
|
|
|
|
Use: "serve [ config file ]",
|
|
|
|
Short: "Connect to the storage and begin serving requests.",
|
|
|
|
Long: ``,
|
2016-10-04 07:27:50 +00:00
|
|
|
Example: "dex serve config.yaml",
|
2016-12-15 21:01:08 +00:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
if err := serve(cmd, args); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
os.Exit(2)
|
|
|
|
}
|
|
|
|
},
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func serve(cmd *cobra.Command, args []string) error {
|
|
|
|
switch len(args) {
|
|
|
|
default:
|
|
|
|
return errors.New("surplus arguments")
|
|
|
|
case 0:
|
|
|
|
// TODO(ericchiang): Consider having a default config file location.
|
2016-12-15 21:01:08 +00:00
|
|
|
return errors.New("no arguments provided")
|
2016-07-25 20:00:28 +00:00
|
|
|
case 1:
|
|
|
|
}
|
|
|
|
|
|
|
|
configFile := args[0]
|
|
|
|
configData, err := ioutil.ReadFile(configFile)
|
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("failed to read config file %s: %v", configFile, err)
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var c Config
|
|
|
|
if err := yaml.Unmarshal(configData, &c); err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("error parse config file %s: %v", configFile, err)
|
|
|
|
}
|
|
|
|
|
|
|
|
logger, err := newLogger(c.Logger.Level, c.Logger.Format)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("invalid config: %v", err)
|
|
|
|
}
|
|
|
|
if c.Logger.Level != "" {
|
|
|
|
logger.Infof("config using log level: %s", c.Logger.Level)
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
2018-07-27 19:51:30 +00:00
|
|
|
if err := c.Validate(); err != nil {
|
|
|
|
return err
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
|
|
|
|
2016-12-15 21:01:08 +00:00
|
|
|
logger.Infof("config issuer: %s", c.Issuer)
|
|
|
|
|
2017-12-20 15:03:32 +00:00
|
|
|
prometheusRegistry := prometheus.NewRegistry()
|
|
|
|
err = prometheusRegistry.Register(prometheus.NewGoCollector())
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to register Go runtime metrics: %v", err)
|
|
|
|
}
|
|
|
|
|
2019-07-30 10:11:02 +00:00
|
|
|
err = prometheusRegistry.Register(prometheus.NewProcessCollector(prometheus.ProcessCollectorOpts{}))
|
2017-12-20 15:03:32 +00:00
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to register process metrics: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
grpcMetrics := grpcprometheus.NewServerMetrics()
|
|
|
|
err = prometheusRegistry.Register(grpcMetrics)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to register gRPC server metrics: %v", err)
|
|
|
|
}
|
|
|
|
|
2016-10-04 07:27:50 +00:00
|
|
|
var grpcOptions []grpc.ServerOption
|
2017-12-20 15:03:32 +00:00
|
|
|
|
2019-08-31 12:17:27 +00:00
|
|
|
allowedTLSCiphers := []uint16{
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
|
|
|
|
tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305,
|
|
|
|
tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305,
|
|
|
|
tls.TLS_RSA_WITH_AES_128_GCM_SHA256,
|
|
|
|
tls.TLS_RSA_WITH_AES_256_GCM_SHA384,
|
|
|
|
}
|
|
|
|
|
2016-10-04 07:27:50 +00:00
|
|
|
if c.GRPC.TLSCert != "" {
|
2019-01-26 17:17:50 +00:00
|
|
|
// Parse certificates from certificate file and key file for server.
|
|
|
|
cert, err := tls.LoadX509KeyPair(c.GRPC.TLSCert, c.GRPC.TLSKey)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("invalid config: error parsing gRPC certificate file: %v", err)
|
|
|
|
}
|
|
|
|
|
|
|
|
tlsConfig := tls.Config{
|
|
|
|
Certificates: []tls.Certificate{cert},
|
|
|
|
MinVersion: tls.VersionTLS12,
|
2019-08-31 12:17:27 +00:00
|
|
|
CipherSuites: allowedTLSCiphers,
|
2019-01-26 17:17:50 +00:00
|
|
|
PreferServerCipherSuites: true,
|
|
|
|
}
|
2016-11-02 21:07:05 +00:00
|
|
|
|
2019-01-26 17:17:50 +00:00
|
|
|
if c.GRPC.TLSClientCA != "" {
|
2016-11-02 21:07:05 +00:00
|
|
|
// Parse certificates from client CA file to a new CertPool.
|
|
|
|
cPool := x509.NewCertPool()
|
|
|
|
clientCert, err := ioutil.ReadFile(c.GRPC.TLSClientCA)
|
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("invalid config: reading from client CA file: %v", err)
|
2016-11-02 21:07:05 +00:00
|
|
|
}
|
2019-07-30 09:08:57 +00:00
|
|
|
if !cPool.AppendCertsFromPEM(clientCert) {
|
2016-12-15 21:01:08 +00:00
|
|
|
return errors.New("invalid config: failed to parse client CA")
|
2016-11-02 21:07:05 +00:00
|
|
|
}
|
|
|
|
|
2019-01-26 17:17:50 +00:00
|
|
|
tlsConfig.ClientAuth = tls.RequireAndVerifyClientCert
|
|
|
|
tlsConfig.ClientCAs = cPool
|
|
|
|
|
|
|
|
// Only add metrics if client auth is enabled
|
2017-12-20 15:03:32 +00:00
|
|
|
grpcOptions = append(grpcOptions,
|
|
|
|
grpc.StreamInterceptor(grpcMetrics.StreamServerInterceptor()),
|
|
|
|
grpc.UnaryInterceptor(grpcMetrics.UnaryServerInterceptor()),
|
|
|
|
)
|
2016-10-04 07:27:50 +00:00
|
|
|
}
|
2019-01-26 17:17:50 +00:00
|
|
|
|
|
|
|
grpcOptions = append(grpcOptions, grpc.Creds(credentials.NewTLS(&tlsConfig)))
|
2016-10-04 07:27:50 +00:00
|
|
|
}
|
|
|
|
|
2016-11-22 23:35:46 +00:00
|
|
|
s, err := c.Storage.Config.Open(logger)
|
2016-07-25 20:00:28 +00:00
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("failed to initialize storage: %v", err)
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
2016-12-15 21:01:08 +00:00
|
|
|
logger.Infof("config storage: %s", c.Storage.Type)
|
|
|
|
|
2016-08-05 16:50:22 +00:00
|
|
|
if len(c.StaticClients) > 0 {
|
2016-12-15 21:01:08 +00:00
|
|
|
for _, client := range c.StaticClients {
|
2019-04-18 10:07:36 +00:00
|
|
|
logger.Infof("config static client: %s", client.Name)
|
2016-12-15 21:01:08 +00:00
|
|
|
}
|
2016-08-05 16:50:22 +00:00
|
|
|
s = storage.WithStaticClients(s, c.StaticClients)
|
|
|
|
}
|
2016-10-05 23:50:02 +00:00
|
|
|
if len(c.StaticPasswords) > 0 {
|
2016-11-03 22:23:56 +00:00
|
|
|
passwords := make([]storage.Password, len(c.StaticPasswords))
|
|
|
|
for i, p := range c.StaticPasswords {
|
|
|
|
passwords[i] = storage.Password(p)
|
|
|
|
}
|
2017-08-23 23:43:01 +00:00
|
|
|
s = storage.WithStaticPasswords(s, passwords, logger)
|
2016-10-05 23:50:02 +00:00
|
|
|
}
|
2016-07-25 20:00:28 +00:00
|
|
|
|
2017-04-17 22:41:41 +00:00
|
|
|
storageConnectors := make([]storage.Connector, len(c.StaticConnectors))
|
|
|
|
for i, c := range c.StaticConnectors {
|
|
|
|
if c.ID == "" || c.Name == "" || c.Type == "" {
|
|
|
|
return fmt.Errorf("invalid config: ID, Type and Name fields are required for a connector")
|
|
|
|
}
|
|
|
|
if c.Config == nil {
|
|
|
|
return fmt.Errorf("invalid config: no config field for connector %q", c.ID)
|
|
|
|
}
|
|
|
|
logger.Infof("config connector: %s", c.ID)
|
|
|
|
|
|
|
|
// convert to a storage connector object
|
|
|
|
conn, err := ToStorageConnector(c)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("failed to initialize storage connectors: %v", err)
|
|
|
|
}
|
|
|
|
storageConnectors[i] = conn
|
|
|
|
}
|
2017-05-01 22:53:37 +00:00
|
|
|
|
|
|
|
if c.EnablePasswordDB {
|
|
|
|
storageConnectors = append(storageConnectors, storage.Connector{
|
|
|
|
ID: server.LocalConnector,
|
|
|
|
Name: "Email",
|
|
|
|
Type: server.LocalConnector,
|
|
|
|
})
|
|
|
|
logger.Infof("config connector: local passwords enabled")
|
|
|
|
}
|
|
|
|
|
2017-04-17 22:41:41 +00:00
|
|
|
s = storage.WithStaticConnectors(s, storageConnectors)
|
|
|
|
|
2016-12-15 21:01:08 +00:00
|
|
|
if len(c.OAuth2.ResponseTypes) > 0 {
|
|
|
|
logger.Infof("config response types accepted: %s", c.OAuth2.ResponseTypes)
|
|
|
|
}
|
|
|
|
if c.OAuth2.SkipApprovalScreen {
|
|
|
|
logger.Infof("config skipping approval screen")
|
|
|
|
}
|
2017-01-14 09:18:48 +00:00
|
|
|
if len(c.Web.AllowedOrigins) > 0 {
|
|
|
|
logger.Infof("config allowed origins: %s", c.Web.AllowedOrigins)
|
2016-12-29 09:25:16 +00:00
|
|
|
}
|
2016-12-15 21:01:08 +00:00
|
|
|
|
2016-12-16 22:42:35 +00:00
|
|
|
// explicitly convert to UTC.
|
|
|
|
now := func() time.Time { return time.Now().UTC() }
|
|
|
|
|
2016-07-25 20:00:28 +00:00
|
|
|
serverConfig := server.Config{
|
2017-01-14 09:18:48 +00:00
|
|
|
SupportedResponseTypes: c.OAuth2.ResponseTypes,
|
|
|
|
SkipApprovalScreen: c.OAuth2.SkipApprovalScreen,
|
2019-08-06 17:18:46 +00:00
|
|
|
AlwaysShowLoginScreen: c.OAuth2.AlwaysShowLoginScreen,
|
2017-01-14 09:18:48 +00:00
|
|
|
AllowedOrigins: c.Web.AllowedOrigins,
|
|
|
|
Issuer: c.Issuer,
|
|
|
|
Storage: s,
|
|
|
|
Web: c.Frontend,
|
|
|
|
Logger: logger,
|
|
|
|
Now: now,
|
2017-12-20 15:03:32 +00:00
|
|
|
PrometheusRegistry: prometheusRegistry,
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
2016-11-03 00:52:49 +00:00
|
|
|
if c.Expiry.SigningKeys != "" {
|
|
|
|
signingKeys, err := time.ParseDuration(c.Expiry.SigningKeys)
|
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("invalid config value %q for signing keys expiry: %v", c.Expiry.SigningKeys, err)
|
2016-11-03 00:52:49 +00:00
|
|
|
}
|
2016-12-15 21:01:08 +00:00
|
|
|
logger.Infof("config signing keys expire after: %v", signingKeys)
|
2016-11-03 00:52:49 +00:00
|
|
|
serverConfig.RotateKeysAfter = signingKeys
|
|
|
|
}
|
|
|
|
if c.Expiry.IDTokens != "" {
|
|
|
|
idTokens, err := time.ParseDuration(c.Expiry.IDTokens)
|
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("invalid config value %q for id token expiry: %v", c.Expiry.IDTokens, err)
|
2016-11-03 00:52:49 +00:00
|
|
|
}
|
2016-12-15 21:01:08 +00:00
|
|
|
logger.Infof("config id tokens valid for: %v", idTokens)
|
2016-11-03 00:52:49 +00:00
|
|
|
serverConfig.IDTokensValidFor = idTokens
|
|
|
|
}
|
2018-12-13 10:40:58 +00:00
|
|
|
if c.Expiry.AuthRequests != "" {
|
|
|
|
authRequests, err := time.ParseDuration(c.Expiry.AuthRequests)
|
|
|
|
if err != nil {
|
|
|
|
return fmt.Errorf("invalid config value %q for auth request expiry: %v", c.Expiry.AuthRequests, err)
|
|
|
|
}
|
|
|
|
logger.Infof("config auth requests valid for: %v", authRequests)
|
|
|
|
serverConfig.AuthRequestsValidFor = authRequests
|
|
|
|
}
|
2016-07-25 20:00:28 +00:00
|
|
|
|
2016-10-13 01:51:32 +00:00
|
|
|
serv, err := server.NewServer(context.Background(), serverConfig)
|
2016-07-25 20:00:28 +00:00
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("failed to initialize server: %v", err)
|
2016-07-25 20:00:28 +00:00
|
|
|
}
|
2016-12-15 21:01:08 +00:00
|
|
|
|
2017-12-20 15:03:32 +00:00
|
|
|
telemetryServ := http.NewServeMux()
|
|
|
|
telemetryServ.Handle("/metrics", promhttp.HandlerFor(prometheusRegistry, promhttp.HandlerOpts{}))
|
|
|
|
|
2016-10-04 07:27:50 +00:00
|
|
|
errc := make(chan error, 3)
|
2017-12-20 15:03:32 +00:00
|
|
|
if c.Telemetry.HTTP != "" {
|
|
|
|
logger.Infof("listening (http/telemetry) on %s", c.Telemetry.HTTP)
|
|
|
|
go func() {
|
|
|
|
err := http.ListenAndServe(c.Telemetry.HTTP, telemetryServ)
|
|
|
|
errc <- fmt.Errorf("listening on %s failed: %v", c.Telemetry.HTTP, err)
|
|
|
|
}()
|
|
|
|
}
|
2016-07-25 20:00:28 +00:00
|
|
|
if c.Web.HTTP != "" {
|
2016-12-13 22:26:08 +00:00
|
|
|
logger.Infof("listening (http) on %s", c.Web.HTTP)
|
2016-07-25 20:00:28 +00:00
|
|
|
go func() {
|
2016-12-15 21:01:08 +00:00
|
|
|
err := http.ListenAndServe(c.Web.HTTP, serv)
|
|
|
|
errc <- fmt.Errorf("listening on %s failed: %v", c.Web.HTTP, err)
|
2016-07-25 20:00:28 +00:00
|
|
|
}()
|
|
|
|
}
|
|
|
|
if c.Web.HTTPS != "" {
|
2019-01-26 17:17:50 +00:00
|
|
|
httpsSrv := &http.Server{
|
|
|
|
Addr: c.Web.HTTPS,
|
|
|
|
Handler: serv,
|
|
|
|
TLSConfig: &tls.Config{
|
2019-08-31 12:17:27 +00:00
|
|
|
CipherSuites: allowedTLSCiphers,
|
2019-01-26 17:17:50 +00:00
|
|
|
PreferServerCipherSuites: true,
|
|
|
|
MinVersion: tls.VersionTLS12,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2016-12-13 22:26:08 +00:00
|
|
|
logger.Infof("listening (https) on %s", c.Web.HTTPS)
|
2016-07-25 20:00:28 +00:00
|
|
|
go func() {
|
2019-01-26 17:17:50 +00:00
|
|
|
err = httpsSrv.ListenAndServeTLS(c.Web.TLSCert, c.Web.TLSKey)
|
2016-12-15 21:01:08 +00:00
|
|
|
errc <- fmt.Errorf("listening on %s failed: %v", c.Web.HTTPS, err)
|
2016-07-25 20:00:28 +00:00
|
|
|
}()
|
|
|
|
}
|
2016-10-04 07:27:50 +00:00
|
|
|
if c.GRPC.Addr != "" {
|
2016-12-13 22:26:08 +00:00
|
|
|
logger.Infof("listening (grpc) on %s", c.GRPC.Addr)
|
2016-10-04 07:27:50 +00:00
|
|
|
go func() {
|
|
|
|
errc <- func() error {
|
|
|
|
list, err := net.Listen("tcp", c.GRPC.Addr)
|
|
|
|
if err != nil {
|
2016-12-15 21:01:08 +00:00
|
|
|
return fmt.Errorf("listening on %s failed: %v", c.GRPC.Addr, err)
|
2016-10-04 07:27:50 +00:00
|
|
|
}
|
|
|
|
s := grpc.NewServer(grpcOptions...)
|
2016-12-12 22:54:01 +00:00
|
|
|
api.RegisterDexServer(s, server.NewAPI(serverConfig.Storage, logger))
|
2017-12-20 15:03:32 +00:00
|
|
|
grpcMetrics.InitializeMetrics(s)
|
2019-08-06 20:56:09 +00:00
|
|
|
if c.GRPC.Reflection {
|
|
|
|
logger.Info("enabling reflection in grpc service")
|
|
|
|
reflection.Register(s)
|
|
|
|
}
|
2016-12-15 21:01:08 +00:00
|
|
|
err = s.Serve(list)
|
|
|
|
return fmt.Errorf("listening on %s failed: %v", c.GRPC.Addr, err)
|
2016-10-04 07:27:50 +00:00
|
|
|
}()
|
|
|
|
}()
|
|
|
|
}
|
|
|
|
|
2016-07-25 20:00:28 +00:00
|
|
|
return <-errc
|
|
|
|
}
|
2016-11-22 23:35:46 +00:00
|
|
|
|
2016-12-15 21:01:08 +00:00
|
|
|
var (
|
|
|
|
logLevels = []string{"debug", "info", "error"}
|
|
|
|
logFormats = []string{"json", "text"}
|
|
|
|
)
|
|
|
|
|
2016-12-16 22:42:35 +00:00
|
|
|
type utcFormatter struct {
|
|
|
|
f logrus.Formatter
|
|
|
|
}
|
|
|
|
|
|
|
|
func (f *utcFormatter) Format(e *logrus.Entry) ([]byte, error) {
|
|
|
|
e.Time = e.Time.UTC()
|
|
|
|
return f.f.Format(e)
|
|
|
|
}
|
|
|
|
|
2019-02-22 12:19:23 +00:00
|
|
|
func newLogger(level string, format string) (log.Logger, error) {
|
2016-11-22 23:35:46 +00:00
|
|
|
var logLevel logrus.Level
|
|
|
|
switch strings.ToLower(level) {
|
|
|
|
case "debug":
|
|
|
|
logLevel = logrus.DebugLevel
|
|
|
|
case "", "info":
|
|
|
|
logLevel = logrus.InfoLevel
|
|
|
|
case "error":
|
|
|
|
logLevel = logrus.ErrorLevel
|
|
|
|
default:
|
2016-12-15 21:01:08 +00:00
|
|
|
return nil, fmt.Errorf("log level is not one of the supported values (%s): %s", strings.Join(logLevels, ", "), level)
|
2016-11-22 23:35:46 +00:00
|
|
|
}
|
|
|
|
|
2016-12-16 22:42:35 +00:00
|
|
|
var formatter utcFormatter
|
2016-11-22 23:35:46 +00:00
|
|
|
switch strings.ToLower(format) {
|
|
|
|
case "", "text":
|
2016-12-16 22:42:35 +00:00
|
|
|
formatter.f = &logrus.TextFormatter{DisableColors: true}
|
2016-11-22 23:35:46 +00:00
|
|
|
case "json":
|
2016-12-16 22:42:35 +00:00
|
|
|
formatter.f = &logrus.JSONFormatter{}
|
2016-11-22 23:35:46 +00:00
|
|
|
default:
|
2016-12-15 21:01:08 +00:00
|
|
|
return nil, fmt.Errorf("log format is not one of the supported values (%s): %s", strings.Join(logFormats, ", "), format)
|
2016-11-22 23:35:46 +00:00
|
|
|
}
|
|
|
|
|
2019-02-22 20:31:46 +00:00
|
|
|
return &logrus.Logger{
|
2016-11-22 23:35:46 +00:00
|
|
|
Out: os.Stderr,
|
2016-12-16 22:42:35 +00:00
|
|
|
Formatter: &formatter,
|
2016-11-22 23:35:46 +00:00
|
|
|
Level: logLevel,
|
2019-02-22 20:31:46 +00:00
|
|
|
}, nil
|
2016-11-22 23:35:46 +00:00
|
|
|
}
|