2011-08-25 21 views
0

我在使用Postgres的項目中使用ActiveRecord,並且我的日誌中充滿了此日誌消息。我想在開發過程中將日誌文件保存爲調試模式。有沒有辦法讓這個特別的警告無聲?我已經使用silent-postgres寶石來沉默一堆其他的東西(如this answer建議,但它不能幫助這種情況)。謝謝!如何從我的日誌中刪除Postgres「PK和連續序列」cruft?

D, [2011-08-25T10:22:10.53#78199] DEBUG -- : PK and serial sequence (1.7ms) SELECT attr.attname, seq.relname 
FROM pg_class seq, 
pg_attribute attr, 
pg_depend dep, 
pg_namespace name, 
pg_constraint cons 
WHERE seq.oid = dep.objid 
AND seq.relkind = 'S' 
AND attr.attrelid = dep.refobjid 
AND attr.attnum = dep.refobjsubid 
AND attr.attrelid = cons.conrelid 
AND attr.attnum = cons.conkey[1] 
AND cons.contype = 'p' 
AND dep.refobjid = '"calls"'::regclass 

回答

2

對我來說,silent-postgres gem確實解決了這個問題。在OP提出這個問題之後,也許它已經被增強了?

+0

我可以通過將Postgres的'min_messages'設置更改爲'warning'來消除它,但是您的回答促使我去檢查確實已更新的gem。新的silent-postgres gem自述文件包含一個說明如何在數據庫連接變量(https://github.com/dolzenko/silent-postgres/blob/master/README)中設置此警告級別的說明,所以感謝提醒我去檢查! – subelsky