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 2020/12/25 10:12:05 UTC

[GitHub] [airflow] XD-DENG commented on a change in pull request #13310: Respect LogFormat when using ES logging with Json Format

XD-DENG commented on a change in pull request #13310:
URL: https://github.com/apache/airflow/pull/13310#discussion_r548849514



##########
File path: tests/providers/elasticsearch/log/test_es_task_handler.py
##########
@@ -251,6 +251,31 @@ def test_set_context_w_json_format_and_write_stdout(self):
         self.es_task_handler.json_format = True
         self.es_task_handler.set_context(self.ti)
 
+    def test_read_with_json_format(self):
+        ts = pendulum.now()
+        formatter = logging.Formatter('[%(asctime)s] {%(filename)s:%(lineno)d} %(levelname)s - %(message)s')
+        self.es_task_handler.formatter = formatter
+        self.es_task_handler.json_format = True

Review comment:
       maybe invalid question: `self.es_task_handler` is also used in other test cases, and default/initial value of `json_format` is `False` here. So should it be changed back to `False` in the end (or in `tearDown`) to avoid potential effect on other test cases (especially the order of test case execution is not guaranteed if I'm not wrong)?
   
   the same quesiton applys to `test_set_context_w_json_format_and_write_stdout ` above.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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