Re: How to print application_name in log_line_prefix (using %a)?

Поиск
Список
Период
Сортировка
От Chris Angelico
Тема Re: How to print application_name in log_line_prefix (using %a)?
Дата
Msg-id CAPTjJmr6DQ-8ckkv6_CK71E0rFyHK_XqKuxcKVUDsKLHhGbKUQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: How to print application_name in log_line_prefix (using %a)?  (Adrian Klaver <adrian.klaver@gmail.com>)
Список pgsql-general
On Tue, Oct 30, 2012 at 12:53 AM, Adrian Klaver <adrian.klaver@gmail.com> wrote:
> On 10/29/2012 04:00 AM, Chris Angelico wrote:
>>
>> Not sure what you mean by that, but my postgresql.conf doesn't have
>> anything about application_name. But if it did, it would be a default
>> that an application can override.
>
>
> Actually it does:
>
> log_line_prefix =  #   %a = application name
>                    #   %u = user name
>                    #   %d = database name
>
> http://www.postgresql.org/docs/9.2/interactive/runtime-config-logging.html#GUC-APPLICATION-NAME

Yep, but it doesn't have anything about _setting_ the app name. The
original question involved a postgresql.conf directive
"application_name = '....'", which I can't find any docs for, nor can
I find in my well-commented default config from the openscg install.

> It is a chicken and egg situation. See section 31.1.2. Parameter Key Words
> of below:
>
> http://www.postgresql.org/docs/9.2/interactive/libpq-connect.html
>
> "application_name
> Specifies a value for the application_name configuration parameter."

That's on the connection, which is where I'm recommending setting it.

There's no magic that picks up your application's executable name, but
you can of course pass argv[0] to libpq as the application_name.

ChrisA


В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: How to print application_name in log_line_prefix (using %a)?
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: Why BgWriterDelay is fixed?