In PostgreSQL 10.0, we have some news:
- Functions pg_ls_logdir() and pg_ls_waldir() can be executed by non-superusers with the proper permissions
- The new function pg_current_logfile() reads the logging collector's current stderr and CSV log output file names:
pgbench=# select pg_current_logfile() ; pg_current_logfile ------------------------ log/postgresql-Sun.log (1 row)