Обсуждение: Can Log filename include database name?

Поиск
Список
Период
Сортировка

Can Log filename include database name?

От
Francisco Reyes
Дата:
I am currently using a log with the file name format:
log_filename = 'postgresql-%Y-%m.log'

Is there any way to change the filename do start witht he database name?

For now just added to add the database name to each line, but it would be
usefull to have each DB written to it's own file. Or even better to be able
to specify on a per database basis whether to log or not.

Re: Can Log filename include database name?

От
"Jaime Casanova"
Дата:
On 7/7/06, Francisco Reyes <lists@stringsutils.com> wrote:
> I am currently using a log with the file name format:
> log_filename = 'postgresql-%Y-%m.log'
>
> Is there any way to change the filename do start witht he database name?
>
> For now just added to add the database name to each line, but it would be
> usefull to have each DB written to it's own file. Or even better to be able
> to specify on a per database basis whether to log or not.
>

so you want a different logfile for every database you connect to?
where do you will log database shared operations like autovacuum, role
creation, maybe even a database creation, tablespace creation, etc...

--
regards,
Jaime Casanova

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs and the universe trying
to produce bigger and better idiots.
So far, the universe is winning."
                                       Richard Cook

Re: Can Log filename include database name?

От
Francisco Reyes
Дата:
Jaime Casanova writes:

> so you want a different logfile for every database you connect to?

An option to specify a log for database.

> where do you will log database shared operations like autovacuum, role
> creation, maybe even a database creation, tablespace creation, etc...

In a global logfile.

Simmilar with what Apache does for virtual domains.
You can specify a log for a virtual domain, and you can also specify a
default/global log file.

Perfects example of where this would be usefull.
Say you have several production databases that work great. You start
developing a new system with a new database and you want to keep an eye on
the performance of the queries for this new system. Right now this would
mean turning on loggin for all of the DBs.. even though you only want to
keep tabs in a single DB.