Use VAULT_LOG_FORMAT as an analogue to LOGXI_FORMAT

This commit is contained in:
Jeff Mitchell 2016-09-22 17:22:02 -04:00
parent d65da5613c
commit 57f3904d74

View file

@ -95,7 +95,12 @@ func (c *ServerCommand) Run(args []string) int {
c.Ui.Output(fmt.Sprintf("Unknown log level %s", logLevel))
return 1
}
switch strings.ToLower(os.Getenv("LOGXI_FORMAT")) {
logFormat := os.Getenv("VAULT_LOG_FORMAT")
if logFormat == "" {
logFormat = os.Getenv("LOGXI_FORMAT")
}
switch strings.ToLower(logFormat) {
case "vault", "vault_json", "vault-json", "vaultjson", "":
c.logger = logformat.NewVaultLoggerWithWriter(logGate, level)
default: