592Part IIIAdvanced Features (Web hosts) and TechniquesIn Microsoft Windows, the

592Part IIIAdvanced Features and TechniquesIn Microsoft Windows, the first three of those (LOG_DEBUGthrough LOG_NOTICE) are consid- ered informational; the fourth and fifth are considered warnings, and the final three are notedin the Event Viewer as Alerts. All of them are shown with a source value of c-client, whichcorresponds to an ancillary process of the Apache server. The Event Viewer shown in Figure 32-2 reflects the results of the preceding listing. Figure 32-2:Errors at various severity levelsLogging to a custom locationUnder Linux, you can use this procedure to write log messages to a file of your choosing. Modify your /etc/syslog.conffile to include this line: local0.debug /var/log/php.logThen restart the syslogdaemon: /etc/init.d/syslog restartWith that done, you can refer to LOG_LOCAL0as part of an openlog()call, as is done here: The LOG_PIDargument that supplements openlog()states that the process ID of the offend- ing thread should be recorded in the log file with the other details. Using error_log() You can use error_log()to send an error message almost anywhere , including to an elec- tronic mail address. It s an easy and convenient way to report on unexpected conditions thatcrop up in your PHP software, yet few developers bother to use it. The basic syntax for error_log()is this: error_log(message, type [,destination])
Please visit our professional web hosting services to find out about cheap and reliable webhost service that will surely answer all your demands.

Leave a Reply