Implement validation of the log section (#2989)

Somehow it was always forgotten.
This commit is contained in:
Alexander Kukushkin
2023-12-20 10:49:33 +01:00
committed by GitHub
parent 206ee91b07
commit 5c3e1a693e
2 changed files with 26 additions and 0 deletions
+12
View File
@@ -937,6 +937,18 @@ validate_etcd = {
schema = Schema({ schema = Schema({
"name": str, "name": str,
"scope": str, "scope": str,
Optional("log"): {
Optional("level"): EnumValidator(('DEBUG', 'INFO', 'WARN', 'WARNING', 'ERROR', 'FATAL', 'CRITICAL'),
case_sensitive=True, raise_assert=True),
Optional("traceback_level"): EnumValidator(('DEBUG', 'ERROR'), raise_assert=True),
Optional("format"): str,
Optional("dateformat"): str,
Optional("max_queue_size"): int,
Optional("dir"): str,
Optional("file_num"): int,
Optional("file_size"): int,
Optional("loggers"): dict
},
Optional("ctl"): { Optional("ctl"): {
Optional("insecure"): bool, Optional("insecure"): bool,
Optional("cacert"): str, Optional("cacert"): str,
+14
View File
@@ -13,6 +13,20 @@ available_dcs = [m.split(".")[-1] for m in dcs_modules()]
config = { config = {
"name": "string", "name": "string",
"scope": "string", "scope": "string",
"log": {
"level": "DEBUG",
"traceback_level": "DEBUG",
"format": "%(asctime)s %(levelname)s: %(message)s",
"dateformat": "%Y-%m-%d %H:%M:%S",
"max_queue_size": 100,
"dir": "/tmp",
"file_num": 10,
"file_size": 1000000,
"loggers": {
"patroni.postmaster": "WARNING",
"urllib3": "DEBUG"
}
},
"restapi": { "restapi": {
"listen": "127.0.0.2:800", "listen": "127.0.0.2:800",
"connect_address": "127.0.0.2:800", "connect_address": "127.0.0.2:800",