PostgreSQL Logging
PostgreSQL Logging
От:
Mag Gam <magawake@gmail.com>
Дата:
Is it possible to isolate logging for each individual database? For example, lets say I have 3 databases: db1, db2, db3. And I want to log db activity (statements, login/logout, etc..) db1, db2, db3 like $PGDATA/db1, $PGDATA/db2, $PGDATA/db3, respectively. Currently everything is logged in $PGDATA/pg_log TIA
Re: PostgreSQL Logging
От:
Oliver Elphick <olly@lfix.co.uk>
Дата:
On Fri, 2005-12-23 at 10:15 -0500, Mag Gam wrote:
> Is it possible to isolate logging for each individual database?
> For example, lets say I have 3 databases: db1, db2, db3. And I want to
> log db activity (statements, login/logout, etc..) db1, db2, db3 like
> $PGDATA/db1, $PGDATA/db2, $PGDATA/db3, respectively.
>
> Currently everything is logged in $PGDATA/pg_log
I don't think you can do it in PostgreSQL itself.
I suggest this method:
Configure PostgreSQL to log to standard output.
When starting the postmaster, redirect standard output to a named
pipe.
Before you start PostgreSQL, start up a perl script to read the named
pipe and write to appropriate logs.
--
Oliver Elphick olly@lfix.co.uk
Isle of Wight http://www.lfix.co.uk/oliver
GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA
========================================
Do you want to know God? http://www.lfix.co.uk/knowing_god.html
Re: PostgreSQL Logging
От:
Mag Gam <magawake@gmail.com>
Дата:
Oliver: Thanks for the reply! I guess I can look into this....thanks On 12/24/05, Oliver Elphick wrote: > On Fri, 2005-12-23 at 10:15 -0500, Mag Gam wrote: > > Is it possible to isolate logging for each individual database? > > For example, lets say I have 3 databases: db1, db2, db3. And I want to > > log db activity (statements, login/logout, etc..) db1, db2, db3 like > > $PGDATA/db1, $PGDATA/db2, $PGDATA/db3, respectively. > > > > Currently everything is logged in $PGDATA/pg_log > > I don't think you can do it in PostgreSQL itself. > > I suggest this method: > > Configure PostgreSQL to log to standard output. > > When starting the postmaster, redirect standard output to a named > pipe. > > Before you start PostgreSQL, start up a perl script to read the named > pipe and write to appropriate logs. > > -- > Oliver Elphick olly@lfix.co.uk > Isle of Wight http://www.lfix.co.uk/oliver > GPG: 1024D/A54310EA 92C8 39E7 280E 3631 3F0E 1EC0 5664 7A2F A543 10EA > ======================================== > Do you want to know God? http://www.lfix.co.uk/knowing_god.html > > > ---------------------------(end of broadcast)--------------------------- > TIP 9: In versions below 8.0, the planner will ignore your desire to > choose an index scan if your joining column's datatypes do not > match >