Name

syslog

Synopsis

bool syslog(int priority, string message)

Sends an error message to the system logging facility. On Unix systems, this is syslog(3); on Windows NT, the messages are logged in the NT Event Log. The message is logged with the given priority, which is one of the following (listed in decreasing order of priority):

LOG_EMERG

Error has caused the system to be unstable

LOG_ALERT

Error notes a situation that requires immediate action

LOG_CRIT

Error is a critical condition

LOG_ERR

Error is a general error condition

LOG_WARNING

Error message is a warning

LOG_NOTICE

Error message is a normal, but significant, condition

LOG_INFO

Error is an informational message that requires no action

LOG_DEBUG

Error is for debugging only

If message contains the characters %m, they are replaced with the current error message, if any is set. Returns true if the logging succeeded and false if a failure occurred.

Get Programming PHP, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.