Closed wildtayne closed 6 years ago
Adding this comment to make it visible. I recommend using this issue to capture the need to add host, application, and other information discussed in this morning's meeting.
I am adding this to the M3 list so it gets attention. We can remove it from the M3 pipeline if a discussion recommends so.
Adding a few comments based on yesterday's discussion:
log_destination
to csvlog
standardizes the log line format to match the format described in section 19.8.4, regardless of other settings like log_line_prefix
. Other settings can effect when new lines are written, but not their structure.application_name
is not actually a server parameter, rather, it is a environment variable set by the client. Confusingly, despite its inclusion in the logging docs, there is no server parameter to enable or disable logging application_name
.application_name
is recorded using csvlog
, however an initial test on my system shows only a blank string logged as application name (despite SHOW application_name
returning psql
). However, manually setting application_name
does cause the new value to be logged for the duration of the session. This will require further testing.Just wanted to add that my installation seems to log application_name
for errors without needing to be manually set, but not for connection activity. The docs linked in the previous comment state:
The application_name can be any string of less than NAMEDATALEN characters (64 characters in a standard build). It is typically set by an application upon connection to the server
Could it be that application_name
is simply not known by the server until some point after a connection is logged? Maybe it is logged on disconnect entries?
Both the -d
command-line option to psql
and the \c
meta-command allows setting application name using a "connection URI".
Any application creating a connection can set the application name via connection info. I expect app name to then show up in the corresponding connection entry in the server log.
The Postgres connection logs record additional information ClassDB does not user, namely
connection_from
andapplication_name
. It would be useful to record these attributes in the connection activity log.