Because our software takes incoming HTTP requests and produces an HTTP response, often in some end user’s browser halfway around the world, it is a little hard to figure out what happened when something goes wrong. Usually, if your program fails, users shake their heads and switch to another website in disgust. They don’t call you and talk for a while about what they did that went wrong and what strange messages they saw. And you do not want them calling you at all hours of the night when they encounter an error. You would be far happier if, in the morning, you could see what went wrong by looking in the log.
A log is generally a file or window that contains messages from your program. You have been using logs all along. Figure 5-8 shows an example log when your application is running locally.
When the App Engine server is running, the log streams out to the window in which you started the AppServer. When you upload your application to the Google infrastructure, it still maintains a log that you can check in a browser.
You can look at the log of a production web application at any time and see what is happening, as shown in Figure 5-9. You can see successful activities, get a sense of patterns of interaction, and see errors in the log.
After a while, you will get used to the logs and their patterns and rhythms. Once you become familiar with your application, it is almost like watching the screens in the Matrix: after a while, it just starts to make sense to you.
In addition ...