跳至內容
選單
此問題已被標幟
5506 瀏覽次數

When I run odoo with the option --log-sql (equivilant to handler=odoo.sql_db:DEBUG) it logs too many sql quires.

I only need to see one query which is called by a specific method. So setting the --log-sql option programmatically will be a nice way to do it.


I tried: 

 sql_logger = logging.getLogger('odoo.sql_db')

 sql_logger.setLevel('DEBUG')

res = Model.search(...)

sql_logger.setLevel('NOTSET')

But it doesn't give any logs unless i use time.sleep() after enable the log. It looks like it take sometime before enabling the log.


頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
12月 23
14453
0
10月 23
33
3
10月 23
788
1
10月 23
569
1
8月 23
2291