You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2019/01/31 06:56:25 UTC

[GitHub] zhongjiajie commented on a change in pull request #4303: [AIRFLOW-3370] Elasticsearch log task handler additional features

zhongjiajie commented on a change in pull request #4303: [AIRFLOW-3370] Elasticsearch log task handler additional features
URL: https://github.com/apache/airflow/pull/4303#discussion_r252552637
 
 

 ##########
 File path: airflow/utils/log/es_task_handler.py
 ##########
 @@ -28,6 +32,43 @@
 from airflow.utils.log.logging_mixin import LoggingMixin
 
 
+class ParentStdout():
+    """
+    Keep track of the ParentStdout stdout context in child process
+    """
+    def __init__(self):
+        self.closed = False
+
+    def write(self, string):
+        sys.__stdout__.write(string)
+
+    def close(self):
+        self.closed = True
+
+
+class JsonFormatter(logging.Formatter):
+    """
+    Custom formatter to allow for fields to be captured in JSON format.
+    Fields are added via the RECORD_LABELS list.
+    TODO: Move RECORD_LABELS into configs/log_config.py
 
 Review comment:
   should we finish it rather than set it `todo`?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services