Showing posts with label Google App Engine. Show all posts
Showing posts with label Google App Engine. Show all posts
Wednesday, July 14, 2010
Intent Based Logging
Does your log message tell a story? Does it have enough context to help you understand the use case and code flow that caused the execution to flow at the given point? In one of our projects, we are experimenting with something I like to call "logging with intent". So what I mean by intent is that, at critical points in the code (entry point, significant fork points, significant intermediate points, etc.), you record the intent of what your code is doing. The implementation of this can choose to use any programming construct that makes sense (we ended up using Thread Local variables for our Google App Engine based project). But the basic concept is that you keep adding "intent breadcrumbs" along the way. Now when it is time to log a critical event (such as a warning or severe or error log), in addition to printing the specific log message, you also print the "intent trace log". So you see the log message, you also get additional context as to what the code was trying to do. Now you could use AOP or other byte code manipulation technique to add intent for every entry and exit point for every method call... but I think then it becomes too fine grained and mechanical (and there may be cases where that is useful, but there are other ways to achieve it rather than making it so pervasive). I am going to track how useful this is in real world in our application and make tweaks as necessary. I will blog about it if I end up making significant changes to the current approach.
Labels:
AOP,
GAE,
Google App Engine,
intent based logging,
logging
Wednesday, March 10, 2010
Using Captcha with Google App Engine
While developing a new registration form for web application, developers want to include captcha to reduce the possibility of accounts being signed up by spammers. Captcha is a visual / audible form of text encryption which is meant to be deciphered only by humans. A spammer would have to write a heuristic program to hack the captcha.
There are many open sourced / freeware utilities available for generating Captchas.
At Cloudglow, we evaluated the following for one of our GAE application:
1. JCAPTCHA (available for download at http://jcaptcha.sourceforge.net/ )
Most of the links provided on this site were not working at the time of our evaluation. We were too reluctant to test something which didn't have main links on this site working. We will get back to it sometime when the site is back in operation.
2. SimpleCaptcha (available for download at http://simplecaptcha.sourceforge.net/ )
Simple captcha is a very simple and powerful utility to generate captchas. We followed SimpleCpatcha's installation and test instructions ( available at http://simplecaptcha.sourceforge.net/installing.html ) and tried it first on Mac. All this was done using eclipse as IDE and it worked in GAE development environment. However when we tested the same on Windows, it immediately returned an error for java.awt.image.BufferedImage class being not supported. Since it is not on GAE's whitelist, it is not recommended to use this class. Please track the following on GAE forum for the latest updates:http://code.google.com/p/googleappengine/issues/detail?id=1423 . We have not filed a bug since if a class is not white-listed by GAE, Google is not responsible for support. We can expect enhancement from google sometime later in future. We did find differences in Google's Mac GAE development server version and Windows version when it comes to complaining about classes that are not in the GAE whitelist. We are working to file a bug on that.
3. ICPATCHA (available for download at http://code.google.com/p/icaptcha/ )
ICAPTCHA uses I/OStreaming which is again not listed on GAE's whitelisted classes. Hence there was no point going any further.
4. RECAPTCHA (available for download at http://recaptcha.net/)
Recaptcha is another free and popular captcha service. This will add a dependency on their service which we do not want to have. You can refer to http://gaejexperiments.wordpress.com/2010/02/22/episode-15-using-a-captcha-in-your-google-app-engine-application/ for details.
In summary, we are back to the drawing table and may end up doing a simple mathematical captcha. Guess it is good enough for now.
There are many open sourced / freeware utilities available for generating Captchas.
At Cloudglow, we evaluated the following for one of our GAE application:
1. JCAPTCHA (available for download at http://jcaptcha.sourceforge.
Most of the links provided on this site were not working at the time of our evaluation. We were too reluctant to test something which didn't have main links on this site working. We will get back to it sometime when the site is back in operation.
2. SimpleCaptcha (available for download at http://simplecaptcha.
Simple captcha is a very simple and powerful utility to generate captchas. We followed SimpleCpatcha's installation and test instructions ( available at http://simplecaptcha.
3. ICPATCHA (available for download at http://code.google.com/p/
ICAPTCHA uses I/OStreaming which is again not listed on GAE's whitelisted classes. Hence there was no point going any further.
4. RECAPTCHA (available for download at http://recaptcha.net/)
Recaptcha is another free and popular captcha service. This will add a dependency on their service which we do not want to have. You can refer to http://gaejexperiments.
In summary, we are back to the drawing table and may end up doing a simple mathematical captcha. Guess it is good enough for now.
Saturday, October 24, 2009
Twilio - Google App Engine
I have been spending time with Twilio and hosting my server side code on Google App Engine. I must agree that Twilio is one of the friendliest service I have used. In fact it is so simple, that I thought to myself... why did it take so long for someone to create such a fundamental telephony building block... especially when open source stuff like Asterisk has been around. I had issues debugging originally but was later able to debug the code on my local GAE development server. I will be blogging more with my specific experiences with Twilio but so far things have been really smooth. This post may sound more like an advertisement for Twilio (no, I do not work for Twilio), but I am really excited to be experimenting with this. More on this later...
Subscribe to:
Posts (Atom)