openlog
(PHP 4, PHP 5, PHP 7, PHP 8)
openlog — Open connection to system logger
Description
openlog() opens a connection to the system logger for a program.
The use of openlog() is optional. It will automatically be called by syslog() if necessary, in which case prefix will default to the empty string.
Parameters
prefixThe string
prefixis added to each message.flagsBitmask of the following constants:
facilityThe
facilityargument is used to specify what type of program is logging the message. This lets the configuration file specify that messages from different facilities will be handled differently. Must be one of the following constants:LOG_AUTHLOG_AUTHPRIVLOG_CRONLOG_DAEMONLOG_KERNLOG_LOCAL[0-7]LOG_LPRLOG_MAILLOG_NEWSLOG_SYSLOGLOG_USERLOG_UUCP
Note: This parameter is ignored on Windows.
Return Values
Always returns true.
Changelog
| Version | Description |
|---|---|
| 8.2.0 | The function now always returns true. Previously it returned false on failure. |
See Also
- syslog() - Generate a system log message
- closelog() - Close connection to system logger
↑ and ↓ to navigate • Enter to select • Esc to close • / to open