openlog
Open connection to system logger
Description
true openlog(string $prefix, int $flags, int $facility)
The use of openlog is optional. If it has not been
called, the connection is opened by the first message that is logged.
When that message comes from syslog, then in PHP 8.1
to 8.3, up to PHP 8.4.27 and up to PHP 8.5.12 the prefix and the facility
are left to the system (the prefix is usually the name of the program,
and php on Windows), and the
syslog.ident and
syslog.facility INI settings
are not used. When it comes from error_log or
mail.log set to syslog, those
settings are used.
Parameters
-
prefix
-
The string prefix is added to each message.
-
flags
-
Bitmask of the following constants:
LOG_CONS
LOG_NDELAY
LOG_ODELAY
LOG_NOWAIT
LOG_PERROR
LOG_PID
-
facility
-
The facility argument 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_AUTH
LOG_AUTHPRIV
LOG_CRON
LOG_DAEMON
LOG_KERN
LOG_LOCAL[0-7]
LOG_LPR
LOG_MAIL
LOG_NEWS
LOG_SYSLOG
LOG_USER
LOG_UUCP
Note:
This parameter is ignored on Windows.
Return Values
Always returns true.