All queries are logged and timed in: db._timings Should also be logged by the DB itself.
On Sunday, 5 May 2019 13:40:04 UTC-7, jcrma...@gmail.com wrote: > > Just to give you some feedback, I tried adding debug=True to the DAL > command and creating a pyDAL logger. Nothing is shown in the logging file. > It gets created (so the logging is working) but nothing shows up. > Also tried pydal instead of pyDAL as the name of the logger with the same > result. > > > domingo, 17 de Março de 2019 às 00:26:54 UTC, Anthony escreveu: >> >> Also, if you set DAL(..., debug=True), I believe all SQL commands will be >> logged to the "pyDAL" logger. >> >> Anthony >> >> On Saturday, March 16, 2019 at 5:57:47 PM UTC-4, Anthony wrote: >>> >>> Commands issued during migration operations are already saved to >>> /databases/sql.log. If you want all commands (i.e., queries), note that on >>> each request, there is db._timings, which is a list of tuples, where the >>> first element of each tuple is the SQL command issued and the second >>> element is the amount of time it took to execute. At the end of every >>> request, you could dump the contents of db._timings to a log. You can do >>> that by assigning a callback function to response._caller(), which wraps >>> all calls to controller actions. Note, it will therefore miss any queries >>> that are run in views, but it's probably not a good idea to run queries in >>> views anyway. You could also set up middleware to do the logging: >>> http://web2py.com/books/default/chapter/29/04/the-core?search=_caller#WSGI >>> . >>> >>> Anthony >>> >>> On Saturday, March 16, 2019 at 4:54:52 PM UTC-4, João Matos wrote: >>>> >>>> Hello, >>>> >>>> I would like to log of all SQL commands web2py sends to SQLlite. Is it >>>> possible? >>>> >>>> Thanks, >>>> >>>> JM >>>> >>> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.