Re: Log errors to file

2010-07-14 Thread Jonathan Hayward
I'm interested and I doubt I'm the only one. On Thu, Jul 8, 2010 at 4:34 AM, euan.godd...@googlemail.com < euan.godd...@gmail.com> wrote: > I have created a decorator for Django views which handles AJAX > tracebacks and sends the traceback back to the AJAX application as > JSON, e.g. > >

Re: Log errors to file

2010-07-09 Thread Sævar Öfjörð
That's something that would be nice to have as a snippet on djangosnippets.org! On Jul 8, 11:34 am, "euan.godd...@googlemail.com" wrote: > I have created a decorator for Django views which handles AJAX > tracebacks and sends the traceback back to the AJAX application as >

Re: Log errors to file

2010-07-08 Thread euan.godd...@googlemail.com
I have created a decorator for Django views which handles AJAX tracebacks and sends the traceback back to the AJAX application as JSON, e.g. {'status':'error', 'message': } It uses the traceback module to output the full traceback. Obviously you need to have a handler that receives this data and

Re: Log errors to file

2010-07-07 Thread Brian Neal
On Jul 7, 4:35 pm, Jonathan Hayward wrote: > I'm working on a view made to output JSON for Ajax use. My log has: > > [07/Jul/2010 17:47:13] "POST /ajax/login HTTP/1.1" 500 50678 > > That looks like Django gave a helpful and detailed stacktrace page, albeit >

Re: Log errors to file

2010-07-07 Thread Jonathan Hayward
Thank you! On Wed, Jul 7, 2010 at 5:35 PM, elijah rutschman wrote: > You could implement a middleware class with a process_exception > method. See: > http://docs.djangoproject.com/en/dev/topics/http/middleware/#process_exception > > -Elijah > > On Wed, Jul 7, 2010 at 4:35

Re: Log errors to file

2010-07-07 Thread elijah rutschman
You could implement a middleware class with a process_exception method. See: http://docs.djangoproject.com/en/dev/topics/http/middleware/#process_exception -Elijah On Wed, Jul 7, 2010 at 4:35 PM, Jonathan Hayward wrote: > I'm working on a view made to

Log errors to file

2010-07-07 Thread Jonathan Hayward
I'm working on a view made to output JSON for Ajax use. My log has: [07/Jul/2010 17:47:13] "POST /ajax/login HTTP/1.1" 500 50678 That looks like Django gave a helpful and detailed stacktrace page, albeit to jQuery expecting JSON. How can I ask Django to log uncaught exceptions to a file or