How to see the query in the log file in Couchbase database?

Viewed 64

I am trying to insert the data in the bucket. But I didnt able to find any query logged in .log file which is present in the /opt/couchbase/var/lib/couchbase/logs# path.

For Example- INSERT INTO Employee (KEY, VALUE) VALUES ( "Emp Id::0199", { "Emp Name": "Ana", "Emp Company" : "GS Lab", "Emp Country" : "India"} ) RETURNING *;

Where is this insert query is logged in the log folder- enter image description here

1 Answers

N1QL info will be logged in the query.log, indexer info will be logged in indexer.log

Logging every SQL statements will be expensive due to concurrency and disk i/o. So, SQL statements will not be logged into the log files.

If the query taking more than 1sec it will logged into completed_requests. You can do select * from system:completed_requests;

Checkout this post more details https://forums.couchbase.com/t/identify-top-n-queries-in-couchbase/28138

Other option will be enable audit and check audit entries.

Related