Re: [web2py] Re: Log db operation to file

2015-04-13 Thread Angelo Compagnucci
Hi Massimo!

2015-04-11 6:09 GMT+02:00 Massimo Di Pierro massimo.dipie...@gmail.com:
 All the db operations are on db._timings along with their timings.
 You can do {{=response.toolbar()}} to embed a toolbar to see them all. You
 can log them to a file yourself

 open('file','w').write(repr(db._timings))

Poking at the coe I found the way!

Enable the logging is simply a matter of:

db._debug =True

When you want to disable:

db._debug = False.

It's really useful for me, the only drawback I found is that sometimes
web2py crashes cause this logging is not threadsafe.

But It could suffice for me right now!

Sincerely, Angelo.



 On Thursday, 9 April 2015 10:23:59 UTC-5, AngeloC wrote:

 Hello List,

 I'm debugging an application not written by me running in production.
 I'm looking for a way to log all db operations to file for a certain
 controller.
 I'm not looking for a global logging of all operations, but only on
 controllers of interest.

 Is there such a nice feature in web2py?

 Thank you!

 --
 Profile: http://it.linkedin.com/in/compagnucciangelo

 --
 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.



-- 
Profile: http://it.linkedin.com/in/compagnucciangelo

-- 
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.


[web2py] Re: Log db operation to file

2015-04-10 Thread Massimo Di Pierro
All the db operations are on db._timings along with their timings.
You can do {{=response.toolbar()}} to embed a toolbar to see them all. You 
can log them to a file yourself

open('file','w').write(repr(db._timings))


On Thursday, 9 April 2015 10:23:59 UTC-5, AngeloC wrote:

 Hello List, 

 I'm debugging an application not written by me running in production. 
 I'm looking for a way to log all db operations to file for a certain 
 controller. 
 I'm not looking for a global logging of all operations, but only on 
 controllers of interest. 

 Is there such a nice feature in web2py? 

 Thank you! 

 -- 
 Profile: http://it.linkedin.com/in/compagnucciangelo 


-- 
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.