Fork of Odoo (formerly OpenERP). [This project is not publically mantained just born for internal usage with some little patches] go to official repository on github.com/odoo/odoo
You will see the following output in the postgresql.log:
... UTC [394452]: [371-1] db=odoo,user=odoo,client=127.0.0.1,app=odoo-740755 LOG: 00000: duration: 0.074 ms statement: SELECT 1
Notice app=odoo-740755 it is the odoo pid that executed the query
and the postgresql PID ... UTC [394452]:
Then you will be able to match the odoo.log and postgresql.log using the PIDs
740755 DEBUG odoo odoo.sql_db.connection: ConnectionPool(used=1/count=2/max=64) Create new connection backend PID 394452
740755 INFO odoo odoo.addons: Running SELECT 1
Notice the Odoo PID 740755 INFO and the postgresql PID backend pid 394452
Note: It will require enable the sub-logger
--log-handler=odoo.sql_db.connection:DEBUG
It will helps to debug what process is executing each query in the database
or if a postgressql PID is showing a error log related to connection (not even from a query)
e.g. The livechat stuck and you don't know what happen but you can see the postgresql.log the following message
for the same PostgreSQL backend_pid related to longpolling odoo pid
[394452]: [371-2] db=odoo,user=odoo,client=127.0.0.1,app=odoo-740755 LOG: XX00: Could not receive data from client: Connection time out
Backport from
It helps to debug queries executed in postgresql from Odoo in order to know where they were called
Enabling the postgresql logs with the following
log_line_prefix
You will see the following output in the postgresql.log:
Notice
app=odoo-740755
it is the odoo pid that executed the query and the postgresql PID... UTC [394452]:
Then you will be able to match the odoo.log and postgresql.log using the PIDs
Notice the Odoo PID
740755 INFO
and the postgresql PIDbackend pid 394452
Note: It will require enable the sub-logger
--log-handler=odoo.sql_db.connection:DEBUG
It will helps to debug what process is executing each query in the database or if a postgressql PID is showing a error log related to connection (not even from a query)
e.g. The livechat stuck and you don't know what happen but you can see the postgresql.log the following message for the same PostgreSQL backend_pid related to longpolling odoo pid
Signed-off-by: Moises Lopez - https://www.vauxoo.com/ moylop260@vauxoo.com
Description of the issue/feature this PR addresses:
Current behavior before PR:
Desired behavior after PR is merged:
-- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr