diff --git a/Script/CastorScript.py b/Script/CastorScript.py index 908d1bb5156e1988a715a14f7e23e02ab7d3e1b0..fc4e7f819fe456eb8c9fd75f9c10bb42bc6b601a 100644 --- a/Script/CastorScript.py +++ b/Script/CastorScript.py @@ -69,8 +69,7 @@ if config.DdmMonitoringEnabled: def main(conf): - # Root should only log to mail or ERS, but initializes root logger if no none set - LogConfig.disable_root_logging_to_stdout() + LogConfig.enable_root_logger() ##### enable mail logging ##### if conf.mailList: diff --git a/Script/cs/Tools/LogConfig.py b/Script/cs/Tools/LogConfig.py index 52c7f357747838f5a4047013020b9a584752198c..a9ab2bbcdec89dac1659ae2f33f8c0e1ed42c95b 100644 --- a/Script/cs/Tools/LogConfig.py +++ b/Script/cs/Tools/LogConfig.py @@ -44,12 +44,10 @@ def set_environment(config, tdaq_app_name): os.environ["TDAQ_ERS_DEBUG"] = config.ers_debug -def disable_root_logging_to_stdout(): - ##### Set root Logging to file: NULL ##### - logging.basicConfig(level=logging.DEBUG, - format='%(asctime)s %(levelname)-8s %(message)s', - datefmt='%a, %d %b %Y %H:%M:%S', - filename= '/dev/null',filemode='w') +def enable_root_logger(): + #let all logs get to the root logger + #(log levels are set in each handler) + logging.getLogger().setLevel("DEBUG") def enable_mail_logging(config): # by default max email sending rate is 10 per hour