On Mon, 7 Nov 2016 23:29:28 +0100
Gilles Darold <gilles.dar...@dalibo.com> wrote:
> Here is the v13 of the patch,
> - I've reverted the patch removing the call to logfile_writename in
> open_csvlogfile function, it is required to write log filename at
> startup when log_destination is set to csvlog. I could not find a
> better place right now, but will try to see if we can avoid the call
> to logfile_writename().
Why is calling logfile_writename() in open_csvlogfile() a problem?
I've not thought too deeply but this is what's in my mind.
The only issue that leaps to mind is overall code simplicity. But
because csv files are opened "on-demand", only when there's something
in the queue to get written to a csv file, it's not clear how to avoid
calling logfile_writename() "on-demand" as well. To do otherwise might
risk putting the name of a csv logfile into current_logfiles when that
csv log file does not yet exist. Or you could wait, and have a csv
log file in existance but not have it reflected in the content of
current_logfiles for some time period. But why?
If there is a problem in code clarity it might be that the csv log files
are not created until there's a csv log entry in the queue. Change this
and other confusion, if there really is any, goes away.
> - Do not write current_logfiles when log_collector is activated but
> log_destination doesn't contained stderr or csvlog. This was creating
> an empty file that can confuse the user.
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
Sent via pgsql-hackers mailing list (email@example.com)
To make changes to your subscription: