kamikaze commented on issue #8484:
URL: https://github.com/apache/airflow/issues/8484#issuecomment-638973315


   > 
   > 
   > Is anyone able to make a clean, stand-alone reproduction case that shows 
this please? (Ideally in the form of a docker image I can pull, or a git repo 
we can clone)
   
   Here is the DAG you can launch and see by yourself.
   
   ```python
   import logging.config
   import os
   from datetime import datetime, timedelta
   from time import sleep
   
   from airflow import DAG
   from airflow.operators.python_operator import PythonOperator
   
   LOGGING_CONFIG = {
       'version': 1,
       'disable_existing_loggers': False,
       'formatters': {
           'standard': {
               'format': '%(asctime)s [%(levelname)s] 
PID=%(process)d:TID=%(thread)d '
                         '%(name)s.%(funcName)s:%(lineno)d: %(message)s'
           },
       },
       'handlers': {
           'default': {
               'level': os.getenv('LOGGING_LEVEL', 'INFO'),
               'class': 'logging.StreamHandler',
               'stream': 'ext://sys.stdout',
               'formatter': 'standard'
           },
       },
       'loggers': {
           '': {
               'handlers': ['default'],
               'level': os.getenv('LOGGING_LEVEL', 'INFO'),
               'propagate': True
           }
       }
   }
   logging.config.dictConfig(LOGGING_CONFIG)
   logger = logging.getLogger(__name__)
   
   default_args = {
       'owner': 'airflow',
       'depends_on_past': False,
       'start_date': datetime(2018, 6, 10),
       'catchup': False,
       'email': ['[email protected]'],
       'email_on_failure': False,
       'email_on_retry': False,
       'retries': 3,
       'retry_delay': timedelta(seconds=5),
       'max_retry_delay': timedelta(seconds=60),
       'retry_exponential_backoff': False,
   }
   
   dag = DAG(dag_id='aaa_test_logging', catchup=False, 
default_args=default_args,
             schedule_interval=None, max_active_runs=1)
   
   
   def aaa_test_logging(**kwargs):
       logger.info('aaa_test_logging START before sleep')
       sleep(5*60)
       logger.info('aaa_test_logging END after sleep')
   
   
   def generate():
       PythonOperator(
           task_id=f'aaa_test_logging',
           python_callable=aaa_test_logging,
           provide_context=True,
           dag=dag,
       )
   
   
   generate()
   ```


----------------------------------------------------------------
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:
[email protected]


Reply via email to