Re: Loggingt psql meta-commands

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: oleg yusim <olegyusim(at)gmail(dot)com>, Andreas Kretschmer <akretschmer(at)spamfence(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Loggingt psql meta-commands
Date: 2015-12-10 20:02:50
Message-ID: 5669DA6A.2010906@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/10/2015 11:49 AM, oleg yusim wrote:
> Andreas, Andrian,
>
> Thank you very much for both pieces of information. It was very helpful.
> Now, let me ask you one more question on the same topic. Is it more
> granular way to control logging PosgreSQL provides, or I pretty much
> reduced to choosing between mod and all?

Yes, overall your choices are none, ddl, mod, and all.

>
> The reason I'm asking is because with 'all" volume of daily logging
> becomes truly ginormous. And for my purposes, I really do not need all
> the SELECT statements to be logged. Only those, which are responsible
> for explicit querying of role/privileges/roles (so, \du, \dp, \z, in
> essence).

Take a look here:

http://www.postgresql.org/docs/current/static/logfile-maintenance.html

at bottom are links to pgBadger and Nagios plugin check_postgres. I have
used neither, so cannot comment on their useability. Still something
like them could be used to harvest log entries into a more condensed
file and then allow you to get rid of the old Postgres log files sooner.

>
> Thanks,
>
> Oleg
>
> On Thu, Dec 10, 2015 at 12:14 PM, Andreas Kretschmer
> <akretschmer(at)spamfence(dot)net <mailto:akretschmer(at)spamfence(dot)net>> wrote:
>
> oleg yusim <olegyusim(at)gmail(dot)com <mailto:olegyusim(at)gmail(dot)com>> wrote:
>
> > Greetings!
> >
> > I'm new to PostgreSQL, working on it from the point of view of Cyber Security
> > assessment. In regards to the here is my question:
> >
> > Is it a way to enable logging for psql prompt meta-commands, such as \du, \dp,
> > \z, etc?
>
> start psql with -E
>
>
> Andreas
> --
> Really, I'm not out to destroy Microsoft. That will just be a completely
> unintentional side effect. (Linus Torvalds)
> "If I was god, I would recompile penguin with --enable-fly." (unknown)
> Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org
> <mailto:pgsql-general(at)postgresql(dot)org>)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2015-12-10 20:16:42 Re: Loggingt psql meta-commands
Previous Message Scott Mead 2015-12-10 20:00:18 Re: Loggingt psql meta-commands