如何分离 postgresql 日志文件?

how can I sperate postgresql logfile?

在postgresql.conf中,log_filename设置为'postgresql-%Y-%m-%d_%H%M%S.log'。 所以,logfile只创建了一个。 我可以按会话或主机分隔日志文件吗?

根据 documentationlog_filename 使用类似 strftime 的参数。似乎除了日期格式之外,您不能用任何其他方式分隔文件名。但是,您可以使用 log_line_prefix 将会话 pid 或客户端主机添加到日志行中。