From 48a151b805224f090577341e7809cd7fc9fcc3a3 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Mon, 12 May 2025 10:10:41 +0200 Subject: [PATCH] docs: cleanup logging section As per kind dive-by review in #1085. --- docs/basic/usage.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/basic/usage.rst b/docs/basic/usage.rst index dd0fd8f04..d3782b576 100644 --- a/docs/basic/usage.rst +++ b/docs/basic/usage.rst @@ -243,7 +243,7 @@ integration between your Python program and your PostgreSQL database: Connection logging ------------------ -Psycopg uses the `logging` module to report the operations happening at +Psycopg uses the stdlib `logging` module to report the operations happening at connection time. If you experience slowness or random failures on connection you can set the ``psycopg`` logger at ``DEBUG`` level to read the operations performed. @@ -255,7 +255,6 @@ A very simple example of logging configuration may be the following: import logging import psycopg - logger = logging.getLogger() logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s") logging.getLogger("psycopg").setLevel(logging.DEBUG) @@ -285,6 +284,6 @@ The resulting log might look like: Please note that a connection attempt might try to reach different servers: either explicitly because the connection string specifies `multiple hosts`__, -or implicitly, because the DNS resolves an host name to multiple IPs. +or implicitly, because the DNS resolves the host name to multiple IPs. .. __: https://www.postgresql.org/docs/current/libpq-connect.html#LIBPQ-MULTIPLE-HOSTS -- 2.47.3