Fix parsing env var, needed to be in the helper too
This commit is contained in:
parent
be694f0287
commit
72b9c4c649
|
@ -101,7 +101,7 @@ func (c *ServerCommand) Run(args []string) int {
|
|||
logFormat = os.Getenv("LOGXI_FORMAT")
|
||||
}
|
||||
switch strings.ToLower(logFormat) {
|
||||
case "vault", "vault_json", "vault-json", "vaultjson", "":
|
||||
case "vault", "vault_json", "vault-json", "vaultjson", "json", "":
|
||||
c.logger = logformat.NewVaultLoggerWithWriter(logGate, level)
|
||||
default:
|
||||
c.logger = log.NewLogger(logGate, "vault")
|
||||
|
|
|
@ -43,8 +43,12 @@ func createVaultFormatter() log.Formatter {
|
|||
ret := &vaultFormatter{
|
||||
Mutex: &sync.Mutex{},
|
||||
}
|
||||
switch os.Getenv("LOGXI_FORMAT") {
|
||||
case "vault_json", "vault-json", "vaultjson":
|
||||
logFormat := os.Getenv("VAULT_LOG_FORMAT")
|
||||
if logFormat == "" {
|
||||
logFormat = os.Getenv("LOGXI_FORMAT")
|
||||
}
|
||||
switch strings.ToLower(logFormat) {
|
||||
case "json", "vault_json", "vault-json", "vaultjson":
|
||||
ret.style = stylejson
|
||||
default:
|
||||
ret.style = styledefault
|
||||
|
|
Loading…
Reference in New Issue