From: Marko Kreen Date: Wed, 12 Sep 2007 09:16:52 +0000 (+0000) Subject: proper login log X-Git-Tag: pgbouncer_1_1~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03176483ff477b82c3e08cbfd715672d97984928;p=pgbouncer proper login log --- diff --git a/src/client.c b/src/client.c index fd84c55..c3263eb 100644 --- a/src/client.c +++ b/src/client.c @@ -127,9 +127,6 @@ static bool decide_startup_pool(PgSocket *client, PktHdr *pkt) return false; } - if (cf_log_connections) - slog_info(client, "login request: db=%s user=%s", dbname, username); - /* check if limit allows, dont limit admin db nb: new incoming conn will be attached to PgSocket, thus get_active_client_count() counts it */ @@ -139,7 +136,17 @@ static bool decide_startup_pool(PgSocket *client, PktHdr *pkt) return false; } } - return set_pool(client, dbname, username); + + /* find pool and log about it */ + if (set_pool(client, dbname, username)) { + if (cf_log_connections) + slog_info(client, "login successful: db=%s user=%s", dbname, username); + return true; + } else { + if (cf_log_connections) + slog_info(client, "login failed: db=%s user=%s", dbname, username); + return false; + } } /* mask to get offset into valid_crypt_salt[] */