php|architect's A/R/T article repository has a new tutorial posted today with a look at logging in your application (the entire application) with the help of the Zend Framework by Stefan Koopmanschap.
There are different reasons for logging information, different strategies for what and how to log, and of course different ways of implementing it. This article will look at why you would want to log, what you want to log and how to do it.
They introduce application-level logging, how it can help, what it can show you, and how it can make finding security issues even easier. They get into the code a bit later on, showing how to use the Zend file functionality to write out to a simple log file. They enhance it with a bit more information in the message, and show how to set a prefix/suffix to each line automatically (like a timestamp and a newline).