add: Log pg version details of listener connection

Follow-up to #4617 adding more information to log entry produced upon successful listener connection establishement.
This commit is contained in:
Michał Kłeczek
2026-04-06 11:11:16 -05:00
committed by Steve Chavez
parent 34a767a5cc
commit b9c8562641
5 changed files with 21 additions and 13 deletions
+3 -3
View File
@@ -45,7 +45,7 @@ data Observation
| SchemaCacheSummaryObs Text
| SchemaCacheLoadedObs Double
| ConnectionRetryObs Int
| DBListenStart (Maybe ByteString) (Maybe ByteString) Text -- host, port, channel
| DBListenStart (Maybe ByteString) (Maybe ByteString) Text Text -- host, port, version string, channel
| DBListenFail Text (Either SQL.ConnectionError SomeException)
| DBListenRetry Int
| DBListenBugHint -- https://github.com/PostgREST/postgrest/issues/3147
@@ -114,8 +114,8 @@ observationMessage = \case
"Attempting to reconnect to the database in " <> (show delay::Text) <> " seconds..."
QueryPgVersionError usageErr ->
"Failed to query the PostgreSQL version. " <> jsonMessage usageErr
DBListenStart host port channel -> do
"Listener connected to " <> show (fold $ host <> fmap (":" <>) port) <> " and listening for database notifications on the " <> show channel <> " channel"
DBListenStart host port fullName channel -> do
"Listener connected to " <> fullName <> " on " <> show (fold $ host <> fmap (":" <>) port) <> " and listening for database notifications on the " <> show channel <> " channel"
DBListenFail channel listenErr ->
"Failed listening for database notifications on the " <> show channel <> " channel. " <>
either showListenerConnError showListenerException listenErr