Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
14180 Lượt xem

I'm trying to log sql events to the ir_logging table. My config is as follows;

log_db = True
log_db_level = warning
log_handler = :INFO
log_level = debug_sql
logfile = /var/log/odoo/odoo-server.log
logrotate = False

I've also tried "info" for the log_db_level parameter and restarted the odoo service before each test. I've created sales orders and performed stock moves, but had zero rows written to the ir_logging table. I can't find this properly documented anywhere. How does it work?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

https://www.odoo.com/documentation/8.0/reference/cmdline.html 

--log-db <dbname>

logs to the ir.logging model (ir_logging table) of the specified database. The database can be the name of a database in the "current" PostgreSQL, or a PostgreSQL URI for e.g. log aggregation
Ảnh đại diện
Huỷ bỏ

Is your database named 'True' ?

Câu trả lời hay nhất

also.. try this setting :

log_level  = :DEBUG

will output more log messages...

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

@Ray; thanks, the only documentation I could find (http://www.mindissoftware.com/2014/09/07/Odoo-logging-configuration-usage-implementation/) had log_db as True and given that is was originally False in my config, this sounded reasonable. I've changed it to the name of my database, and I'm getting some logging, but not logging of SQL statements. Tried a number of things including setting the log_handler = openerp.sql_db:DEBUG. Still no SQL logging.

Ảnh đại diện
Huỷ bỏ

I have always used "log_level = debug_sql"

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 22
5636
1
thg 10 21
3300
2
thg 11 18
10204
0
thg 2 18
3930
2
thg 7 16
7563