Re: [PATCHES] log_line_info - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: [PATCHES] log_line_info
Date
Msg-id 40416E2F.8040106@dunslane.net
Whole thread Raw
In response to Re: [PATCHES] log_line_info  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers

Bruce Momjian wrote:

>Andrew Dunstan wrote:
>  
>
>>>Nice.  Only two comments --- does this mean we should remove log_pid? 
>>>Seems it is now duplicate functionality.  Is that the only duplication?
>>>Also, I don't see any documention changes in the patch, but I assume you
>>>will work on that before final.
>>>
>>>      
>>>
>>I will do docs. We could sensibly get rid of log_pid and log_timestamp 
>>with my latest patch. I would also suggest getting rid of 
>>log_source_port, since there really isn't any reason *not* to log the 
>>source port. Do you want me to make those changes in my patch? Or I can 
>>leave them for now and we can get rid of them when everyone is happy.
>>    
>>
>
>I agree, but let's make it a separate patch.
>
>Oh, I think we still need log_timestamp for postmaster-generated lines,
>no?  What does log_line_info output for postmaster-generated logs?
>

I have fixed the postmaster lines issue. There is a new escape %X that 
says "postmaster and friends stop here".

Example, with log_timestamp = false and log_pid = false and 
log_line_info = '%T [%P] %X %U@%D(%C:%S) %R %I line:%L ' :


2004-02-28 20:24:49 [11154] LOG:  database system was shut down at 
2004-02-28 20:24:20 EST
2004-02-28 20:24:49 [11154] LOG:  checkpoint record is at 0/9D1874
2004-02-28 20:24:49 [11154] LOG:  redo record is at 0/9D1874; undo 
record is at 0/0; shutdown TRUE
2004-02-28 20:24:49 [11154] LOG:  next transaction ID: 467; next OID: 17145
2004-02-28 20:24:49 [11154] LOG:  database system is ready
2004-02-28 20:25:30 [11158]  
[unknown]@[unknown](40413f8a.2b96:2004-02-28 20:25:30)   line:1 LOG:  
connection received: host=alphonso port=45621
2004-02-28 20:25:30 [11158]  andrew@blurflx(40413f8a.2b96:2004-02-28 
20:25:30) alphonso:45621 authentication line:2 LOG:  connection 
authorized: user=andrew database=blurflx
2004-02-28 20:25:34 [11158]  andrew@blurflx(40413f8a.2b96:2004-02-28 
20:25:30) alphonso:45621 idle line:3 LOG:  statement: SELECT n.nspname 
as "Schema",         c.relname as "Name",         CASE c.relkind WHEN 'r' THEN 'table' WHEN 'v' THEN 'view' WHEN 
'i' THEN 'index' WHEN 'S' THEN 'sequence' WHEN 's' THEN 'special' END as 
"Type",         u.usename as "Owner",        c2.relname as "Table"       FROM pg_catalog.pg_class c            JOIN
pg_catalog.pg_indexi ON i.indexrelid = c.oid            JOIN pg_catalog.pg_class c2 ON i.indrelid = c2.oid
LEFTJOIN pg_catalog.pg_user u ON u.usesysid = c.relowner            LEFT JOIN pg_catalog.pg_namespace n ON n.oid =
c.relnamespace      WHERE c.relkind IN ('i','')             AND n.nspname NOT IN ('pg_catalog', 'pg_toast')
ANDpg_catalog.pg_table_is_visible(c.oid)       ORDER BY 1,2;
 
2004-02-28 20:25:38 [11158]  andrew@blurflx(40413f8a.2b96:2004-02-28 
20:25:30) alphonso:45621 idle line:4 LOG:  disconnection: session time: 
0:00:08.50 user=andrew database=blurflx host=alphonso:45621
2004-02-28 20:25:44 [11149] LOG:  received smart shutdown request
2004-02-28 20:25:44 [11170] LOG:  shutting down
2004-02-28 20:25:46 [11170] LOG:  database system is shut down


>
>Also, should we call the option just log_line?  Is that clearer, or
>log_line_prefix?
>  
>

I floated the name log_line_info a while back and noone objected. I 
don't think "log_line" is any clearer - quite the contrary IMNSHO.

cheers

andrew





pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [PATCHES] log_line_info
Next
From: Richard Huxton
Date:
Subject: Re: [ADMIN] Schema comparisons