Commit d111af98 authored by Matt Traudt's avatar Matt Traudt Committed by juga
Browse files

Add 2 conf opts for logging to file, but not used yet

parent a316ff66
......@@ -87,6 +87,13 @@ min_relays = 50
to_file = yes
# Whether or not to log to stdout
to_stdout = no
# If logging to file, how large (in bytes) should the file be allowed to get
# before rotating to a new one. 10485760 is 10 MiB. If zero or number of
# backups is zero, never rotate the log file.
to_file_max_bytes = 10485760
# If logging to file, how many backups to keep. If zero or max bytes is zero,
# never rotate the log file.
to_file_num_backups = 50
# Level to log at. Debug, info, warning, error, critical.
level = info
to_file_level = ${level}
......
......@@ -282,8 +282,13 @@ def _validate_logging(conf):
'to_file': {},
'to_stdout': {},
}
ints = {
'to_file_max_bytes': {'minimum': 0, 'maximum': None},
'to_file_num_backups': {'minimum': 0, 'maximum': None},
}
unvalidated = ['format', 'to_file_format', 'to_stdout_format']
all_valid_keys = list(bools.keys()) + list(enums.keys()) + unvalidated
all_valid_keys = list(bools.keys()) + list(enums.keys()) + \
list(ints.keys()) + unvalidated
errors.extend(_validate_section_keys(conf, sec, all_valid_keys, err_tmpl))
errors.extend(_validate_section_bools(conf, sec, bools, err_tmpl))
errors.extend(_validate_section_enums(conf, sec, enums, err_tmpl))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment