Prev | Current Page 282 | Next

W. Jason Gilmore

"Beginning PHP and MySQL: From Novice to Professional"

The user can then simply enter a
URL similar to http://www.example.com/subscribers.txt and proceed to do what he
will with your soon-to-be furious subscriber base.
Displaying Startup Errors
Enabling the display_startup_errors directive will display any errors encountered
during the initialization of the PHP engine. Like display_errors, you should have this
directive enabled during testing and disabled when the site is live.
Logging Errors
Errors should be logged in every instance because such records provide the most
valuable means for determining problems specific to your application and the PHP
engine. Therefore, you should keep log_errors enabled at all times. Exactly to where
these log statements are recorded depends on the error_log directive.
Identifying the Log File
Errors can be sent to the system syslog or can be sent to a file specified by the administrator
via the error_log directive. If this directive is set to syslog, error statements
will be sent to the syslog on Linux or to the event log on Windows.
If you??™re unfamiliar with the syslog, it??™s a Linux-based logging facility that offers an
API for logging messages pertinent to system and application execution. The Windows
event log is essentially the equivalent of the Linux syslog. These logs are commonly
viewed using the Event Viewer.
CHAPTER 8 ?–  ERRO R AND EXCEPTION HANDL ING 217
Setting the Maximum Log Line Length
The log_errors_max_len directive sets the maximum length, in bytes, of each logged
item.


Pages:
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294