Files
airflow/java-sdk/jul
Jason(Zhe-You) Liu 275730a9cf Java-SDK: replace AirflowJulHandler.install() with setup() (#68986)
* Java SDK: replace AirflowJulHandler.install() with setup()

install() only added the handler and left JUL's default ConsoleHandler in
place, so every task log record was also written to stderr, which Airflow
captures as task.stderr at ERROR level: each line appeared twice and INFO
records were mislabeled as errors. setup() clears the root logger's handlers
before installing AirflowJulHandler so records flow only through Airflow.
Renamed per review feedback on #68938; the SDK is experimental, so no
deprecation path is needed.

* Java SDK: let AirflowJulHandler.setup() keep existing root handlers

Clearing every root handler is the right default, but it forecloses setups
where a user has intentionally attached their own handler (for example a
FileHandler that mirrors logs to disk) that does not conflict with Airflow's
task-log and task.stderr capture. Raised in review on #68986. A clean=true
default preserves the de-duplicating behaviour while clean=false adds the
AirflowJulHandler alongside the existing handlers. Both paths stay idempotent
so repeated calls never install more than one AirflowJulHandler.
2026-06-26 11:58:51 +09:00
..