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 2022/01/21 13:13:28 UTC

[GitHub] [airflow] potiuk commented on issue #21013: logging in Operator not work

potiuk commented on issue #21013:
URL: https://github.com/apache/airflow/issues/21013#issuecomment-1018493602


   You are using logging module improperly. By `logging,info` (and similar) you are logging stuff to "root" logger:
   
   https://docs.python.org/3/library/logging.html#logging.info
   
   > logging.info(msg, *args, **kwargs)ΒΆ
   Logs a message with level INFO on the root logger. The arguments are interpreted as for debug().
   
   Instead you should log message to "airflow.task" logger if you want messages to show up in task log:
   
   ```
   logger = logging.getLogger("airflow.task")
   logger.info(...)
   ``


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org