logs-fix-4
This commit is contained in:
parent
f9e1316145
commit
d6fec9121c
|
@ -13,6 +13,7 @@ import (
|
||||||
"github.com/authorizerdev/authorizer/server/oauth"
|
"github.com/authorizerdev/authorizer/server/oauth"
|
||||||
"github.com/authorizerdev/authorizer/server/refs"
|
"github.com/authorizerdev/authorizer/server/refs"
|
||||||
"github.com/authorizerdev/authorizer/server/routes"
|
"github.com/authorizerdev/authorizer/server/routes"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
// VERSION is used to define the version of authorizer from build tags
|
// VERSION is used to define the version of authorizer from build tags
|
||||||
|
@ -26,25 +27,25 @@ func main() {
|
||||||
cli.ARG_REDIS_URL = flag.String("redis_url", "", "Redis connection string")
|
cli.ARG_REDIS_URL = flag.String("redis_url", "", "Redis connection string")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
// global log level
|
||||||
|
logrus.SetFormatter(&logs.LogTextFormatter{})
|
||||||
|
|
||||||
constants.VERSION = VERSION
|
constants.VERSION = VERSION
|
||||||
|
|
||||||
// initialize logrus
|
// initialize required envs (mainly db, env file path and redis)
|
||||||
log := logs.InitLog(refs.StringValue(cli.ARG_LOG_LEVEL))
|
err := memorystore.InitRequiredEnv()
|
||||||
|
if err != nil {
|
||||||
|
logrus.Fatal("Error while initializing required envs: ", err)
|
||||||
|
}
|
||||||
|
|
||||||
// set logrus formatter
|
log := logs.InitLog(refs.StringValue(cli.ARG_LOG_LEVEL))
|
||||||
log.SetFormatter(&logs.LogTextFormatter{})
|
log.SetFormatter(&logs.LogTextFormatter{})
|
||||||
|
|
||||||
// initialize required envs (mainly db, env file path and redis)
|
// initialize memory store
|
||||||
err := memorystore.InitRequiredEnv()
|
err = memorystore.InitMemStore()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Error while initializing required envs: ", err)
|
log.Fatal("Error while initializing memory store: ", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize required envs (mainly db, env file path and redis)
|
|
||||||
err = memorystore.InitRequiredEnv()
|
|
||||||
if err != nil {
|
|
||||||
log.Fatal("Error while initializing required envs: ", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// initialize db provider
|
// initialize db provider
|
||||||
err = db.InitDB()
|
err = db.InitDB()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user