阻止 PostgreSQL 日志文件填满磁盘

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4710102/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 22:47:09  来源:igfitidea点击:

Stop PostgreSQL log files from filling up disk

postgresql

提问by goh

I'm running PostgreSQL 8.4 on an Ubuntu server. I realized that my disk is out of space because the log file had became too large. Can I adjust what gets written to the log file?

我在 Ubuntu 服务器上运行 PostgreSQL 8.4。我意识到我的磁盘空间不足,因为日志文件变得太大。我可以调整写入日志文件的内容吗?

回答by Peter Eisentraut

Edit /etc/postgresql/8.4/main/postgresql.confand change or disable the various log_*parameters. Then reload postgresql.

编辑/etc/postgresql/8.4/main/postgresql.conf和更改或禁用各种log_*参数。然后重新加载postgresql。

You might also want to check what gets written to the logs. By default, there should not be that much logging. Possibly, your application is throwing lots of errors, which is what's filling up your hard disks.

您可能还想检查写入日志的内容。默认情况下,不应该有那么多日志记录。可能是您的应用程序抛出了大量错误,这导致您的硬盘被填满。