From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re:
Date: Sat, 18 Jun 2022 09:07:00 +0200
Message-ID: <20220618070700.awyi7zucbsyjtkde@hjp.at> (raw)
In-Reply-To: <CAA3DN=VLyxXBumCMP0xzrnCtodKGT3HcL1TfpfdT3rsjtZVeDg@mail.gmail.com>
References: <CAJWX+ENqyXXuFtS97aznvs_nvg5ZTGSuODOM0s9Ek53Hf-CpEg@mail.gmail.com>
<CAA3DN=VLyxXBumCMP0xzrnCtodKGT3HcL1TfpfdT3rsjtZVeDg@mail.gmail.com>
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.
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,
...), 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
--
_ | Peter J. Holzer | Story must make more sense than reality.
|_|_) | |
| | | hjp@hjp.at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: hjp-pgsql@hjp.at
Subject: Re:
In-Reply-To: <20220618070700.awyi7zucbsyjtkde@hjp.at>
References: <CAJWX+ENqyXXuFtS97aznvs_nvg5ZTGSuODOM0s9Ek53Hf-CpEg@mail.gmail.com> <CAA3DN=VLyxXBumCMP0xzrnCtodKGT3HcL1TfpfdT3rsjtZVeDg@mail.gmail.com> <20220618070700.awyi7zucbsyjtkde@hjp.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox