Hybrid View
-
20 Jun 2012 4:56 AM #1
How to create txt file and also How to write all javascript exceptions to d same file
How to create txt file and also How to write all javascript exceptions to d same file
I want to log/write all javascript errors to one text file when ever an error happens in my JavaScript functions. using try catch block, i am catching exception. i need to log this exception to txt file. how can i achive this one sencha touch2
How can I do that. Please help me.
-
20 Jun 2012 5:34 AM #2
you can not write it to a FILE cause your browser has no access to the file system. you can only write it to the browsers console with console.log()
trainings / workshops / consulting: Sencha Touch / Ext JS
Profile on SenchaDevs
www: http://www.nils-dehl.de
twitter: nilsdehl
meetup: Sencha Touch / Ext JS Meetup Frankfurt
videos: http://vimeo.com/album/1621422
conference photos: http://www.flickr.com/photos/nils-dehl/
-
20 Jun 2012 9:03 PM #3
-
21 Jun 2012 2:16 AM #4
You can also use localstorage... However, be aware, that if an iOS device has turned the private browsing on, you will be very likely to get lots of errors, and of course sencha to fail to load.
-
21 Jun 2012 2:39 AM #5
-
21 Jun 2012 9:12 AM #6
When you want to get exceptions I would say that local storage is a really bad way, since you woudn't be able to retrieve those, unless you have the device.
Much rather would I make some kind of remote service to which you can call and store your exceptions. If you are running the code on the same domain as the service you can use an ajax proxy for the purpose. If you have to run cross domain you'd have to do some tricks to make it work (probably making your own proxy).
But basically a remote service that stores them in an database and then combined with some kind of gui to view them would probably be the easiest way.
If you want to combine with the offline scenario you might be able to make a localstorage to cache it and then call the remote service when possible.Developer/Alien Technologies at Mobile Ambitions Aps, Denmark.


Reply With Quote