Re: How to print application_name in log_line_prefix (using %a)?
От | Tianyin Xu |
---|---|
Тема | Re: How to print application_name in log_line_prefix (using %a)? |
Дата | |
Msg-id | CABBDWwc1PWX-dyymD6Awbws37GE5RW=uWnPzydKVoauA9=BFNw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: How to print application_name in log_line_prefix (using %a)? (Chris Angelico <rosuav@gmail.com>) |
Ответы |
Re: How to print application_name in log_line_prefix (using %a)?
|
Список | pgsql-general |
Thanks a lot, Chris!
Yes, the manual said that "It is typically set by an application upon connection to the server." exactly your approach.
But the examples you gave me is to print the application_name in the query results, aren't they? Do you know how to make it as the prefix of the local log messages?
T
--
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/
Yes, the manual said that "It is typically set by an application upon connection to the server." exactly your approach.
But the examples you gave me is to print the application_name in the query results, aren't they? Do you know how to make it as the prefix of the local log messages?
T
On Sun, Oct 28, 2012 at 10:27 PM, Chris Angelico <rosuav@gmail.com> wrote:
On Mon, Oct 29, 2012 at 4:18 PM, Tianyin Xu <tixu@cs.ucsd.edu> wrote:I'm not familiar with this usage of setting application_name in
> However, I have the following configuration settings in postgresql.conf
>
> application_name = 'mypostgres'
> log_line_prefix = '[%a] '
>
postgresql.conf - usually I set it as part of the database connection.
For example:
//In Pike:
object db=Sql.Sql("pgsql://USER:PASSWORD@HOST/DATABASE",(["search_path":"SCHEMA,public","application_name":"APPLICATION"]));
//In PHP:
$db=pg_connect('dbname=DATABASE host=HOST user=USER password=PASSWORD');
pg_query($db,"set application_name='APPLICATION'");
pg_query($db,"set search_path to SCHEMA,public");
ChrisA
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
--
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/
В списке pgsql-general по дате отправления: