8 there are other reasons but experience tends to show this is the first thing to |
8 there are other reasons but experience tends to show this is the first thing to |
9 track down. Luckily, CubicWeb provides a configuration option to log RQL |
9 track down. Luckily, CubicWeb provides a configuration option to log RQL |
10 queries. In your ``all-in-one.conf`` file, set the **query-log-file** option:: |
10 queries. In your ``all-in-one.conf`` file, set the **query-log-file** option:: |
11 |
11 |
12 # web application query log file |
12 # web application query log file |
13 query-log-file=~/myapp-rql.log |
13 query-log-file=/home/user/myapp-rql.log |
14 |
14 |
15 Then restart your application, reload your page and stop your application. |
15 Then restart your application, reload your page and stop your application. |
16 The file ``myapp-rql.log`` now contains the list of RQL queries that were |
16 The file ``myapp-rql.log`` now contains the list of RQL queries that were |
17 executed during your test. It's a simple text file containing lines such as:: |
17 executed during your test. It's a simple text file containing lines such as:: |
18 |
18 |
26 CubicWeb also provides the **exlog** command to examine and summarize data found |
26 CubicWeb also provides the **exlog** command to examine and summarize data found |
27 in such a file: |
27 in such a file: |
28 |
28 |
29 .. sourcecode:: sh |
29 .. sourcecode:: sh |
30 |
30 |
31 $ cubicweb-ctl exlog ~/myapp-rql.log |
31 $ cubicweb-ctl exlog /home/user/myapp-rql.log |
32 0.07 50 Any A WHERE X eid %(x)s, X firstname A {} |
32 0.07 50 Any A WHERE X eid %(x)s, X firstname A {} |
33 0.05 50 Any A WHERE X eid %(x)s, X lastname A {} |
33 0.05 50 Any A WHERE X eid %(x)s, X lastname A {} |
34 0.01 1 Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, E employees X, X modification_date AA {} |
34 0.01 1 Any X,AA ORDERBY AA DESC WHERE E eid %(x)s, E employees X, X modification_date AA {} |
35 0.01 1 Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s {, } |
35 0.01 1 Any X WHERE X eid %(x)s, X owned_by U, U eid %(u)s {, } |
36 0.01 1 Any B,T,P ORDERBY lower(T) WHERE B is Bookmark,B title T, B path P, B bookmarked_by U, U eid %(x)s {} |
36 0.01 1 Any B,T,P ORDERBY lower(T) WHERE B is Bookmark,B title T, B path P, B bookmarked_by U, U eid %(x)s {} |