diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index f923ca13a744..eec4bb65e54d 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -7856,7 +7856,9 @@ log_line_prefix = '%m [%p] %q%u@%d/%a '
Controls whether a detailed log message is produced
when a lock acquisition fails. This is useful for analyzing
the causes of lock failures. Currently, only lock failures
- due to SELECT NOWAIT is supported.
+ caused by NOWAIT, such as in
+ SELECT ... NOWAIT or
+ LOCK TABLE ... NOWAIT, are supported.
The default is off. Only superusers and
users with the appropriate SET privilege
can change this setting.
diff --git a/src/backend/storage/lmgr/lmgr.c b/src/backend/storage/lmgr/lmgr.c
index f50962983c37..b5de5394b1e1 100644
--- a/src/backend/storage/lmgr/lmgr.c
+++ b/src/backend/storage/lmgr/lmgr.c
@@ -157,7 +157,7 @@ ConditionalLockRelationOid(Oid relid, LOCKMODE lockmode)
SetLocktagRelationOid(&tag, relid);
res = LockAcquireExtended(&tag, lockmode, false, true, true, &locallock,
- false);
+ log_lock_failure);
if (res == LOCKACQUIRE_NOT_AVAIL)
return false;