05.05.2013 Views

Programming PHP

Programming PHP

Programming PHP

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

openlog<br />

int openlog(string identity, int options, int facility)<br />

Opens a connection to the system logger. Each message sent to the logger with a subsequent<br />

call to syslog( ) is prepended by identity. Various options can be specified by<br />

options; OR any options you want to include. The valid options are:<br />

The third parameter, facility, tells the system log what kind of program is logging to the<br />

system log. The following facilities are available:<br />

ord<br />

int ord(string string)<br />

Returns the ASCII value of the first character in string.<br />

pack<br />

LOG_CONS If an error occurs while writing to the system log, write the error to<br />

the system console.<br />

LOG_NDELAY Open the system log immediately.<br />

LOG_ODELAY Delay opening the system log until the first message is written to it.<br />

LOG_PERROR Print this message to standard error in addition to writing it to the<br />

system log.<br />

LOG_PID Include the PID in each message.<br />

LOG_AUTH Security and authorization errors (deprecated; if LOG_AUTHPRIV is<br />

available, use it instead)<br />

LOG_AUTHPRIV Security and authorization errors<br />

LOG_CRON Clock daemon (cron and at) errors<br />

LOG_DAEMON Errors for system daemons not given their own codes<br />

LOG_KERN Kernel errors<br />

LOG_LPR Line printer subsystem errors<br />

LOG_MAIL Mail errors<br />

LOG_NEWS USENET news system errors<br />

LOG_SYSLOG Errors generated internally by syslogd<br />

LOG_AUTHPRIV Security and authorization errors<br />

LOG_USER Generic user-level errors<br />

LOG_UUCP UUCP errors<br />

string pack(string format, mixed arg1[, mixed arg2[, ... mixed argN]])<br />

Creates a binary string containing packed versions of the given arguments according to<br />

format. Each character may be followed by a number of arguments to use in that format, or<br />

428 | Appendix A: Function Reference<br />

This is the Title of the Book, eMatter Edition<br />

Copyright © 2002 O’Reilly & Associates, Inc. All rights reserved.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!