What is the performance cost of enabling "log_lock_waits" on Postgres?
This is essentially for free, and you should enable it in all databases unless the workload is designed to have long lock waits regularly (which would be a design bug).

These error messages are written by the deadlock detector, which is expensive to run, which is why PostgreSQL doesn't run it unless someone has to wait deadlock_timeout seconds for a lock. 1 second is very long, so this should not happen normally (database transactions should be way shorter).

But the deadlock detector has to run anyway, and these log messages are just a side effect you get for free.