[PATCH] Include application_name in "connection authorized" log message - Mailing list pgsql-hackers

From Don Seiler
Subject [PATCH] Include application_name in "connection authorized" log message
Date
Msg-id CAHJZqBB_Pxv8HRfoh+AB4KxSQQuPVvtYCzMg7woNR3r7dfmopw@mail.gmail.com
Whole thread Raw
Responses Re: [PATCH] Include application_name in "connection authorized" logmessage
List pgsql-hackers
Good afternoon, all.

In trying to troubleshoot the source of a recent connection storm, I was frustrated to find that the app name was not included in the connection messages. It is there in the log_line_prefix on the disconnection messages but I would prefer it be directly visible with the connection itself. With some guidance from Stephen Frost I've put together this patch which does that.

It adds a new application_name field to the Port struct, stores the application name there when processing the startup packet, and then reads from there when logging the "connection authorized" message.

Thanks,
Don.

--
Don Seiler
www.seiler.us
Attachment

pgsql-hackers by date:

Previous
From: Ashwin Agrawal
Date:
Subject: Re: Avoiding Tablespace path collision for primary and standby
Next
From: Tomas Vondra
Date:
Subject: memory leak when serializing TRUNCATE in reorderbuffer