Its prototype follows:
void define_syslog_variables(void)
You need to execute this function before using any of the following logging
functions.
Opening the Logging Connection
The openlog() function opens a connection to the platform??™s system logger and sets
the stage for the insertion of one or more messages into the system log by designating
several parameters that will be used within the log context. Its prototype follows:
int openlog(string ident, int option, int facility)
Several parameters are supported, including the following:
ident: Identifies messages. It is added to the beginning of each entry. Typically
this value is set to the name of the program. Therefore, you might want to identify
PHP-related messages such as ???PHP??? or ???PHP5.???
CHAPTER 8 ?– ERRO R AND EXCEPTION HANDL ING 219
option: Determines which logging options are used when generating the message.
A list of available options is offered in Table 8-2. If more than one option is required,
separate each option with a vertical bar. For example, you could specify three of the
options like so: LOG_ODELAY | LOG_PERROR | LOG_PID.
facility: Helps determine what category of program is logging the message. There
are several categories, including LOG_KERN, LOG_USER, LOG_MAIL, LOG_DAEMON, LOG_AUTH,
LOG_LPR, and LOG_LOCALN, where N is a value ranging between 0 and 7. Note that the
designated facility determines the message destination.
Pages:
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297