Prayson W. Daniel
Prayson W. Daniel

Reputation: 15558

How do I stop Airflow from Logging connection string?

When I excute command to add a connection uri in Airflow, it echo the username and password:

airflow connections add 'example_db' \
    --conn-uri 'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/example_db'

Airflow logs:

 Successfully added `conn_id`=example_db : postgresql://username:userpassword@postgres:5432/example_db

How do I mute this output? I don't want userpassword logged from the environment variable.

Upvotes: 1

Views: 304

Answers (1)

Bob Haffner
Bob Haffner

Reputation: 8483

I'm not aware of any Airflow settings or configs to accomplish this, but you could pipe these commands to /dev/null

Example

airflow connections add 'example_db' --conn-uri \ 
'postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/example_db' \ 
> /dev/null

Upvotes: 1

Related Questions