在每个请求中,我的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中,执行软件包安装并重新启动服务器.
原文链接:https://www.f2er.com/postgresql/192694.htmlgem "silent-postgres"