Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7Fs2-0001jr-2A for pgsql-admin@arkaria.postgresql.org; Fri, 22 Mar 2019 08:49:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h7Fry-0002de-7b for pgsql-admin@arkaria.postgresql.org; Fri, 22 Mar 2019 08:49:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7Frx-0002dX-Vk for pgsql-admin@lists.postgresql.org; Fri, 22 Mar 2019 08:49:42 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7Frv-0007wp-Gl for pgsql-admin@lists.postgresql.org; Fri, 22 Mar 2019 08:49:41 +0000 Received: from smadev.internal.net (pc131.internal.net [10.9.200.131]) by hermes.gatewaynet.com (8.15.2/8.15.2/Debian-8) with ESMTPS id x2M8nVbq006227 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 22 Mar 2019 10:49:36 +0200 Received: from smadev.internal.net (smadev [10.9.200.131]) by smadev.internal.net (8.15.2/8.15.2) with ESMTP id x2M8nV8B034774 for ; Fri, 22 Mar 2019 10:49:31 +0200 (EET) (envelope-from achill@matrix.gatewaynet.com) Subject: Re: Is there a way to log only a particular user connection attempts in Postgres? To: pgsql-admin@lists.postgresql.org References: <1553228652335-0.post@n3.nabble.com> From: Achilleas Mantzios Message-ID: Date: Fri, 22 Mar 2019 10:49:31 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:60.0) Gecko/20100101 Thunderbird/60.3.2 MIME-Version: 1.0 In-Reply-To: <1553228652335-0.post@n3.nabble.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.100.2 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-22.7 required=5.0 tests=ALL_TRUSTED,DYN_HAM_COORD, DYN_HAM_IT,DYN_HAM_NAUTICAL,DYN_HAM_SIGNAT1,DYN_SPAM_MED6, DYN_SPAM_MED7,DYN_SPAM_SUBJ,TW_PG,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello On 22/3/19 6:24 π.μ., pavan95 wrote: > Hi Community, > > Is there any way to log a user login/connection attempts in a log file ? > > I know that we have log_connections parameter for this. But it logs all the > connection attempts for all users across the instance. > > But here my requirement is to exclude login attempts for a particular > user(as in my case its application user and postgres user). You can't set that on a user level. At least not with pgsql 11. What you can do is use connection pooling (which is a good thing) so that login connections/disconnections will be not so frequent as to create noise in your log files. > > I have also seen "pg_audit" but it is not logging any login events. > > Please shed some light on this scenario. > > Looking forward to hear from you. > > Regards, > Pavan Teja, > 9841380956 > > > > -- > Sent from: http://www.postgresql-archive.org/PostgreSQL-admin-f2076596.html > -- Achilleas Mantzios IT DEV Lead IT DEPT Dynacom Tankers Mgmt