diff --git a/coordinator/Processor.py b/coordinator/Processor.py index b99653c41cc36224f7bde6211c789861c68ac239..9341f71b14ded4150dbf435ee8d4a1ba4e670bf7 100755 --- a/coordinator/Processor.py +++ b/coordinator/Processor.py @@ -156,6 +156,13 @@ class Processor: 'filename': job_log_file_path, 'mode': 'a', # 'a' for append }, + # logging for job to stderr (useful for Airflow to catch in its logs) + 'handler_stderr': { + 'class': 'logging.StreamHandler', + 'level': 'INFO', + 'formatter': 'simple', + 'filters': ['mask_passwords'] + }, # to email errors to maintainers 'handler_buffered_email': { 'class': 'BufferingSMTPHandler.BufferingSMTPHandler', @@ -176,7 +183,7 @@ class Processor: # i.e. with logging.getLogger('Process.') script_name: { 'level': 'INFO', - 'handlers': ['handler_rot_file', 'handler_file', 'handler_buffered_email'], + 'handlers': ['handler_rot_file', 'handler_file', 'handler_buffered_email', 'handler_stderr'], 'propagate': True, }, # this is activated when this script is called on the command line @@ -184,7 +191,7 @@ class Processor: # i.e. with logging.getLogger(__name__) when name == '__main__' '__main__': { 'level': 'INFO', - 'handlers': ['handler_rot_file', 'handler_file', 'handler_buffered_email'], + 'handlers': ['handler_rot_file', 'handler_file', 'handler_buffered_email', 'handler_stderr'], 'propagate': True, } }