leoneuwald opened a new issue, #34865:
URL: https://github.com/apache/airflow/issues/34865

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### What happened
   
   Hey.
   
   We are running Airflow 2.6.3 in K8s, and when we use the decorator 
@task.virtualenv, the logs aren't printed (S3 remote or Pod output).
   
   I tried this 
https://github.com/apache/airflow/issues/27012#issuecomment-1361342168, but it 
also doesn’t work.
   
   ### What you think should happen instead
   
   The logs should be printed in the Pod output or written in the S3 remote.
   
   ### How to reproduce
   
   `
   from airflow.decorators import task, dag
   
   
   @dag(default_args={
           'owner': 'data',
           'start_date': '2023-07-07'
       },
       schedule_interval=None,
       max_active_runs=1,
       catchup=False,
       tags=['test'])
   def test_virtualenv():
   
       @task.virtualenv(
           task_id='test_log_virtual_env',
       )
       def test_log_virtual_env():
           import logging
           logger = logging.getLogger(__name__)
           logger.setLevel(logging.INFO)
           logger.info('Start log')
   
       @task
       def test_log():
           import logging
           logger = logging.getLogger(__name__)
           logger.setLevel(logging.INFO)
           logger.info('Start log')
   
       test_log() >> test_log_virtual_env()
   
   
   test_virtualenv_dag = test_virtualenv()
   `
   
   Run the following DAG in Airflow deployed in Kubernetes and check that we 
only see the `Start log`, in the test_log task. The test_log_virtual_env does 
not print anything.
   
   ### Operating System
   
   K8s
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to