postgresql – 沉默postgres在rails 3日志中记录垃圾邮件

前端之家收集整理的这篇文章主要介绍了postgresql – 沉默postgres在rails 3日志中记录垃圾邮件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在每个请求中,我的development.log包含很多条目,如下所示:
sql (0.5ms)   SELECT a.attname,format_type(a.atttypid,a.atttypmod),d.adsrc,a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"table1"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

sql (0.5ms)   SELECT a.attname,a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"table2"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum

这些都完全淹没了我实际关心的日志信息.有没有一个很好的方式来沉默这些额外的信息?

将其添加到您的Gemfile中,执行软件包安装并重新启动服务器.
gem "silent-postgres"
原文链接:https://www.f2er.com/postgresql/192694.html

猜你在找的Postgre SQL相关文章