anmolxlight opened a new pull request, #68239:
URL: https://github.com/apache/airflow/pull/68239

   ## Summary
   
   When remote logging is not configured (default), the triggerer still logs a 
spurious warning on every task completion:
   
   ```
   [warning] remote_log_handler_unavailable [airflow.logging.remote] 
note='Remote log handler could not be loaded; logs will be available locally 
only.'
   ```
   
   This happens because `upload_to_remote()` unconditionally warns when 
`load_remote_log_handler()` returns `None`, even when remote logging was never 
enabled (`remote_logging = False` is the default).
   
   ## Fix
   
   Only emit the warning when `remote_logging` is explicitly set to `True` in 
the `[logging]` config. When remote logging is not configured, silently return 
— there is nothing to warn about.
   
   ## Changes
   
   - **`task-sdk/src/airflow/sdk/log.py`**: Added a `conf.getboolean("logging", 
"remote_logging", fallback=False)` check before emitting the warning. The 
warning is now only shown when the user has explicitly enabled remote logging 
but the handler could not be loaded.
   - **`task-sdk/tests/task_sdk/test_log.py`**: Updated the existing test and 
added a new test case covering the silent path when remote logging is disabled.
   
   Closes #68230
   


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