Logging and Learning
tom.posterous.com
tom.posterous.com
The general flavor, with more than a few details fictionalized: picture your standard credit card order form.
First Name: Elaine Smith who teaches in 6th grade at George Washington Middle
Last Name: School
Now, in a real comedy of unlikely events, everybody just passed that transaction along to the next step of the chain.
My app: Paypal collects billing details, let them worry about the correctness of them.
Paypal: She's got a username and password and a Paypal balance? Transaction authorized!
Payment processor: A transaction from Paypal? OK, email straight to her spam folder, hit the script on Patrick's site to record transaction.
Script: First name, please? Hurk. writes error message to log file
Customer: Where's my stuff?
Me: checks records That's funny, I can't find a record of this transaction anywhere in the database... Why don't I spend thirty minutes fruitlessly searching for variations of her name? Oh, no dice, hmm, one last thing to try: sudo grep "George Washington" production.log... Oh crud.
New feature as of this evening: any hits on the sale notification script which do not result in a successful save to the database are going to displayed on my web dashboard in Blaze Orange.
To prevent this from happening, I just put the request, state, and response objects into my object database now. It doesn't really take up all that much space, and it is nice to have a big picture of what is going on with the app.
The next step is to start logging data flow at key points.
(BTW, this data all "dies"... but it is nice to have when something is obviously failing. You can always process data you have; you can't process data you don't have. Log now, ask questions later.)