PHP syslog() Function

❮ PHP Network Reference

Example

Open and close connection of system logger:

<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>


Definition and Usage

The syslog() function generates a system log message.

Syntax

syslog(priority, message)

Parameter Values

Parameter Description
priority Required. Specifies ... Can be one of the following options:
  • LOG_EMERG
  • LOG_ALERT
  • LOG_CRIT
  • LOG_ERR
  • LOG_WARNING
  • LOG_NOTICE
  • LOG_INFO
  • LOG_DEBUG
message Required. Specifies the message to send


Technical Details

Return Value: TRUE on success, FALSE on failure
PHP Version: 4.0+

❮ PHP Network Reference
Copyright 1999-2023 by Refsnes Data. All Rights Reserved.