Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o2SY4-00046N-Fn for pgsql-general@arkaria.postgresql.org; Sat, 18 Jun 2022 07:07:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o2SY3-0000ZG-27 for pgsql-general@arkaria.postgresql.org; Sat, 18 Jun 2022 07:07:11 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o2SY2-0000Z1-Jw for pgsql-general@lists.postgresql.org; Sat, 18 Jun 2022 07:07:10 +0000 Received: from mail.hjp.at ([212.17.106.138] helo=rorschach.hjp.at) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1o2SXx-00036Z-5L for pgsql-general@lists.postgresql.org; Sat, 18 Jun 2022 07:07:09 +0000 Received: by rorschach.hjp.at (Postfix, from userid 1000) id 6078F7220; Sat, 18 Jun 2022 09:07:00 +0200 (CEST) Date: Sat, 18 Jun 2022 09:07:00 +0200 From: "Peter J. Holzer" To: pgsql-general@lists.postgresql.org Subject: Re: Message-ID: <20220618070700.awyi7zucbsyjtkde@hjp.at> Mail-Followup-To: pgsql-general@lists.postgresql.org References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="73robrwzgakq5bpb" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --73robrwzgakq5bpb Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2022-06-17 10:38:57 +0800, Abdul Qoyyuum wrote: > Best if you just maintain the logs into a log file instead of a database > table.=A0 That depends on what you want to use those logs for. If you just want to look at them when something goes wrong, I agree: Logs files are simple, fast to write, take little space (and usually compress well), can be trimmed with a text editor and attached to a ticket or sent by mail ... But if you want to process them further (generate statistics or other reports, anonymize them, combine them with data from other sources, =2E..), it is useful to store them in some structured format (aka a "database"). That doesn't necessarily mean a relational database, it could be a nosql database (for example, ElasticSearch is very popular for storing logs), but if you are already using PostgreSQL in your project, using it for logs suggests itself. hp --=20 _ | Peter J. Holzer | Story must make more sense than reality. |_|_) | | | | | hjp@hjp.at | -- Charles Stross, "Creative writing __/ | http://www.hjp.at/ | challenge!" --73robrwzgakq5bpb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmKteY8ACgkQ8g5IURL+ KF0sXQ//bmdZmiNYEif162fxYX3zeZtTB57EpnT/Wx/UDVonYnFlwu2wUxMYp2sM 8BnHcoJEObVFXCCbSZnqo6HJb8ls0qvlpdkf1ai62STkoFD+NYtCbgk1t9yWpj5Y mWAdhqSelNWUYHL07uF90pprx1WyvTmPGm31D7S/IoiFWFmnreDYu97ZBJ4zALC4 IcNxUfqxBHKm6HRPgqpT/TBCPzhzc7rkA+qpcmKcLWwasPr4X6FphdedIvXn8S8a Y4fD487G7iRrZOz1S3bILZX+ix2ov8uxgzFvSABYF+8RrWIZlasjDrfsd04YKN/r qDfCPsem6RFrwMExca+B5ApTtGf5u53yZN3Eq7lp0GJBMnM0si0BslUa/uFrBfBo m/naM3MRUL4r8f532cqAZHB7w/bEODih0U5t3QYhpCvdSpDjE1Sa7kUOuqM2h2OT qW1Kn+RAkZ6MvO/TSXpaHGnO0Vgmrur1iUkhjIuP0MqGiVdC1KFWW6FDJ1CsHcB2 8Ge0GkWWa7e24aHgr2T1Agwb67fA2yA3Yx1fsOKD8wyNb6NWvHx13g37s1yzQklb qfG9i0k2AFH+olJZ3WCD5PJi+8lf0gCpzPTufPNlszCWb/MQZc04mMxbbQuLnaqa 4WfBpAd2kEYeEuMc2zw/bMZAfYpl8UZjiP273jhPK2Bdn497JRE= =nI3E -----END PGP SIGNATURE----- --73robrwzgakq5bpb--