[tor-commits] [sbws/master] Validate and use syslog format

pastly at torproject.org pastly at torproject.org
Wed Jul 11 15:05:40 UTC 2018


commit 15e6cdb718f470762451562b43877e6d720947df
Author: juga0 <juga at riseup.net>
Date:   Tue Jul 10 08:00:32 2018 +0000

    Validate and use syslog format
---
 sbws/util/config.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/sbws/util/config.py b/sbws/util/config.py
index 6917033..585d23c 100644
--- a/sbws/util/config.py
+++ b/sbws/util/config.py
@@ -134,6 +134,7 @@ def configure_logging(args, conf):
     # Set some stuff that needs config parser's interpolation
     conf['formatter_to_file']['format'] = conf['logging']['to_file_format']
     conf['formatter_to_stdout']['format'] = conf['logging']['to_stdout_format']
+    conf['formatter_to_syslog']['format'] = conf['logging']['to_syslog_format']
     conf[logger]['level'] = conf['logging']['level'].upper()
     conf['handler_to_file']['level'] = conf['logging']['to_file_level'].upper()
     conf['handler_to_stdout']['level'] = \
@@ -294,7 +295,8 @@ def _validate_logging(conf):
         'to_file_max_bytes': {'minimum': 0, 'maximum': None},
         'to_file_num_backups': {'minimum': 0, 'maximum': None},
     }
-    unvalidated = ['format', 'to_file_format', 'to_stdout_format']
+    unvalidated = ['format', 'to_file_format', 'to_stdout_format',
+                   'to_syslog_format']
     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))





More information about the tor-commits mailing list