Re:

From: "Peter J(dot) Holzer" <hjp-pgsql(at)hjp(dot)at>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re:
Date: 2022-06-18 07:07:00
Message-ID: 20220618070700.awyi7zucbsyjtkde@hjp.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)hjp(dot)at | -- Charles Stross, "Creative writing
__/ | http://www.hjp.at/ | challenge!"

In response to

  • Re: at 2022-06-17 02:38:57 from Abdul Qoyyuum

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2022-06-18 10:28:01 Re: '{"x": 42, "y": null}'::jsonb != '{"x": 42}'::jsonb ... Really?
Previous Message Peter J. Holzer 2022-06-18 06:44:53 Re: ERROR: failed to find conversion function from key_vals_nn to record[]