pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Separate log for a specfic database
5+ messages / 5 participants
[nested] [flat]

* Separate log for a specfic database
@ 2018-02-28 17:35  Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
  0 siblings, 2 replies; 5+ messages in thread

From: Ertan Küçükoðlu @ 2018-02-28 17:35 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I am using PostgreSQL 9.6.6 on Debian 9 Stretch system. Installed using
apt-get.
I wonder if I can have two log files. One for complete database server and
another for one specific database in the server.
I have already read below link, but cannot understand if that is possible,
or how.
https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html

I appreciate any help.

Regards,
Ertan Küçükoðlu







^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Separate log for a specfic database
@ 2018-02-28 18:05  David G. Johnston <david.g.johnston@gmail.com>
  parent: Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
  1 sibling, 1 reply; 5+ messages in thread

From: David G. Johnston @ 2018-02-28 18:05 UTC (permalink / raw)
  To: Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr>; +Cc: pgsql-admin

On Wednesday, February 28, 2018, Ertan Küçükoğlu <
ertan.kucukoglu@1nar.com.tr> wrote:

> Hello,
>
> I am using PostgreSQL 9.6.6 on Debian 9 Stretch system. Installed using
> apt-get.
> I wonder if I can have two log files. One for complete database server and
> another for one specific database in the server.
> I have already read below link, but cannot understand if that is possible,
> or how.
> https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html
>
>
When it says:

" This parameter can only be set in the postgresql.conf file or on the
server command line. "

It is scoped to the cluster and all databases therein.  To do what you
desire you would need to put the unique database into its own cluster.

David J.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Separate log for a specfic database
@ 2018-02-28 18:17  Evan Rempel <erempel@uvic.ca>
  parent: David G. Johnston <david.g.johnston@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Evan Rempel @ 2018-02-28 18:17 UTC (permalink / raw)
  To: pgsql-admin@lists.postgresql.org

On 02/28/2018 10:05 AM, David G. Johnston wrote:
> On Wednesday, February 28, 2018, Ertan Küçükoğlu 
> <ertan.kucukoglu@1nar.com.tr <mailto:ertan.kucukoglu@1nar.com.tr>> wrote:
>
>     Hello,
>
>     I am using PostgreSQL 9.6.6 on Debian 9 Stretch system. Installed
>     using
>     apt-get.
>     I wonder if I can have two log files. One for complete database
>     server and
>     another for one specific database in the server.
>     I have already read below link, but cannot understand if that is
>     possible,
>     or how.
>     https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html
>     <https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html;
>
>
> When it says:
>
> " This parameter can only be set in the postgresql.conf file or on the 
> server command line. "
>
> It is scoped to the cluster and all databases therein.  To do what you 
> desire you would need to put the unique database into its own cluster.
>
> David J.

That is not exactly true.

Logging could be set up to use syslog and if the database name is in the 
log lines
then some filtering and routing of hose messages could go into their own 
files.

This would require a mature syslog environment but it is possible.

Evan.





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Separate log for a specfic database
@ 2018-02-28 18:41  Keith <keith@keithf4.com>
  parent: Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
  1 sibling, 1 reply; 5+ messages in thread

From: Keith @ 2018-02-28 18:41 UTC (permalink / raw)
  To: Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr>; +Cc: pgsql-admin

On Wed, Feb 28, 2018 at 12:35 PM, Ertan Küçükoğlu <
ertan.kucukoglu@1nar.com.tr> wrote:

> Hello,
>
> I am using PostgreSQL 9.6.6 on Debian 9 Stretch system. Installed using
> apt-get.
> I wonder if I can have two log files. One for complete database server and
> another for one specific database in the server.
> I have already read below link, but cannot understand if that is possible,
> or how.
> https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html
>
> I appreciate any help.
>
> Regards,
> Ertan Küçükoğlu
>
>
>
>
>
Not sure what you're reasoning may be, but if it's just to be able to do
log analysis, there are tools that can do that for you as long as you have
the database name in the log_line_prefix. Take a look at pgbadger

http://dalibo.github.io/pgbadger/

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Separate log for a specfic database
@ 2018-03-01 06:25  Ibrahim Edib Kokdemir <kokdemir@gmail.com>
  parent: Keith <keith@keithf4.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Ibrahim Edib Kokdemir @ 2018-03-01 06:25 UTC (permalink / raw)
  To: Ertan Küçükoğlu <ertan.kucukoglu@1nar.com.tr>; +Cc: pgsql-admin

We have huge amount of logs files and when using syslog all logs go to
journal and journal cannot handle that amount logs. Then we have found
nxlog. It is a good solution and double work. Send pg logs as usual and
read the read from the file, filter them and either put them into separate
files or to another syslog server. Here is the link. Best ever log
collector.
https://nxlog.co/products/nxlog-community-edition.

2018-02-28 21:41 GMT+03:00 Keith <keith@keithf4.com>:

>
>
> On Wed, Feb 28, 2018 at 12:35 PM, Ertan Küçükoğlu <
> ertan.kucukoglu@1nar.com.tr> wrote:
>
>> Hello,
>>
>> I am using PostgreSQL 9.6.6 on Debian 9 Stretch system. Installed using
>> apt-get.
>> I wonder if I can have two log files. One for complete database server and
>> another for one specific database in the server.
>> I have already read below link, but cannot understand if that is possible,
>> or how.
>> https://www.postgresql.org/docs/9.6/static/runtime-config-logging.html
>>
>> I appreciate any help.
>>
>> Regards,
>> Ertan Küçükoğlu
>>
>>
>>
>>
>>
> Not sure what you're reasoning may be, but if it's just to be able to do
> log analysis, there are tools that can do that for you as long as you have
> the database name in the log_line_prefix. Take a look at pgbadger
>
> http://dalibo.github.io/pgbadger/
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2018-03-01 06:25 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-02-28 17:35 Separate log for a specfic database Ertan Küçükoðlu <ertan.kucukoglu@1nar.com.tr>
2018-02-28 18:05 ` David G. Johnston <david.g.johnston@gmail.com>
2018-02-28 18:17   ` Evan Rempel <erempel@uvic.ca>
2018-02-28 18:41 ` Keith <keith@keithf4.com>
2018-03-01 06:25   ` Ibrahim Edib Kokdemir <kokdemir@gmail.com>

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