FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 945e1ddc authored by L. Bower's avatar L. Bower
Browse files

adding console logging (streamhandler) so outout sent to loggers is also sent...

adding console logging (streamhandler) so outout sent to loggers is also sent to the screen (useful for Airflow to pick up and display in its logs)
parent 0355fb7c
No related branches found
No related tags found
No related merge requests found
......@@ -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,
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment