我已经在 heroku 中成功部署了一个生产级应用程序。现在我正在研究日志记录和监控。
不幸的是,我找不到方法来控制在 heroku 日志、papertrail 等中记录的内容。每隔 1 或 2 分钟,我会收到以下类型的消息:
app/heroku-postgres source=DATABASE addon=postgresql-slippery-76303
sample#current_transaction=1408 sample#db_size=11563679bytes
sample#tables=24 sample#active-connections=13 sample#waiting-
connections=0 sample#index-cache-hit-rate=0.99834 sample#table-cache-
hit-rate=0.99896 sample#load-avg-1m=0.01 sample#load-avg-5m=0.005
sample#load-avg-15m=0 sample#read-iops=0 sample#write-iops=0.098361
sample#tmp-disk-used=33849344 sample#tmp-disk-available=72944943104
sample#memory-total=4044932kB sample#memory-free=1741488kB
sample#memory-cached=1968548kB sample#memory-postgres=44600kB
我从 heroku 中找到了关于此的文档页面:
https://devcenter.heroku.com/articles/heroku-postgres-metrics-logs
不过,他们忘了告诉我如何禁用这些 postgres 指标日志。
一般来说,我想过滤记录的内容,因为 heroku 有记录行的限制,我只想记录对我有用的内容。因此,如果我想禁用来自特定程序(如 app/heroku-postgres)的所有日志,我希望可以选择这样做。
heroku中有没有办法配置这个?