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

From: Chris Angelico <rosuav(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: How to print application_name in log_line_prefix (using %a)?
Date: 2012-10-29 05:27:47
Message-ID: CAPTjJmoVcH2DGmw2DPFmad_b8-uH41RV6QW=dwgroxuf=WFh4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Oct 29, 2012 at 4:18 PM, Tianyin Xu <tixu(at)cs(dot)ucsd(dot)edu> wrote:
> However, I have the following configuration settings in postgresql.conf
>
> application_name = 'mypostgres'
> log_line_prefix = '[%a] '
>

I'm not familiar with this usage of setting application_name in
postgresql.conf - usually I set it as part of the database connection.
For example:

//In Pike:
object db=Sql.Sql("pgsql://USER:PASSWORD(at)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message 高健 2012-10-29 06:05:57 Why PGDLLIMPORT is needed
Previous Message Tianyin Xu 2012-10-29 05:24:02 How to print application_name in log_line_prefix (using %a)?