I get current log file by using SQL without getting in server via ssh. So I use a query like the one below;
SELECT pg_read_binary_file(
concat_ws('/',
current_setting('log_directory'),
'postgresql-Fri.log'
)
);
Log files are not too big so i am fine with that. The thing is, I cannot use this query in a generic way. Is there a way to get 'postgresql-Fri.log' from my log_filename setting which is currently postgresql-%a.log but the format can differ?