diff --git a/config/flipt.schema.cue b/config/flipt.schema.cue index 9e6ddf2e48..313d63f8f5 100644 --- a/config/flipt.schema.cue +++ b/config/flipt.schema.cue @@ -1,5 +1,7 @@ package flipt +import "strings" + #FliptSpec: { // flipt-schema-v1 // @@ -94,13 +96,20 @@ package flipt conn_max_lifetime?: int } + _#lower: ["debug", "error", "fatal", "info", "panic", "trace", "warn"] + _#all: _#lower + [ for x in _#lower {strings.ToUpper(x)}] #log: { file?: string encoding?: "json" | "console" | *"console" level?: #log.#log_level grpc_level?: #log.#log_level + keys?: { + time?: string | *"T" + level?: string | *"L" + message?: string | *"M" + } - #log_level: "debug" | "DEBUG" | "error" | "ERROR" | "fatal" | "FATAL" | "info" | "INFO" | "PANIC" | "panic" | "trace" | "TRACE" | "warn" | "WARN" + #log_level: or(_#all) } #meta: { @@ -129,5 +138,4 @@ package flipt } #ui: enabled?: bool | *true - ... } diff --git a/config/flipt.schema.json b/config/flipt.schema.json index 053d2c4cec..06694938f9 100644 --- a/config/flipt.schema.json +++ b/config/flipt.schema.json @@ -309,6 +309,10 @@ "grpc_level": { "$ref": "#/definitions/log/$defs/log_level", "type": "string" + }, + "keys": { + "$ref": "#/definitions/log/$defs/log_keys", + "type": "object" } }, "required": [], @@ -332,6 +336,25 @@ "warn", "WARN" ] + }, + "log_keys": { + "type": "object", + "additionalProperties": false, + "properties": { + "level": { + "type": "string", + "default": "L" + }, + "time": { + "type": "string", + "default": "T" + }, + "message": { + "type": "string", + "default": "M" + } + }, + "required": [] } } },