define_syslog_variables
(PHP 4, PHP 5 < 5.4.0)
define_syslog_variables — Initializes all syslog related variables
Description
void define_syslog_variables
( void
)
Initializes all variables used in the syslog functions.
Return Values
No value is returned.
Variable | Constant equal | Meaning | Notes |
---|---|---|---|
$LOG_EMERG | LOG_EMERG |
System is unusable | |
$LOG_ALERT | LOG_ALERT |
Immediate action required | |
$LOG_CRIT | LOG_CRIT |
Critical conditions | |
$LOG_ERR | LOG_ERR |
||
$LOG_WARNING | LOG_WARNING |
||
$LOG_NOTICE | LOG_NOTICE |
||
$LOG_INFO | LOG_INFO |
||
$LOG_DEBUG | LOG_DEBUG |
||
$LOG_KERN | LOG_KERN |
||
$LOG_USER | LOG_USER |
Genetic user level | |
$LOG_MAIL | LOG_MAIL |
Log to email | |
$LOG_DAEMON | LOG_DAEMON |
Other system daemons | |
$LOG_AUTH | LOG_AUTH |
||
$LOG_SYSLOG | LOG_SYSLOG |
Not available on Netware | |
$LOG_LPR | LOG_LPR |
||
$LOG_NEWS | LOG_NEWS |
Usenet new | Not available on HP-UX |
$LOG_CRON | LOG_CRON |
Not available on all platforms | |
$LOG_AUTHPRIV | LOG_AUTHPRIV |
Not available on AIX | |
$LOG_LOCAL0 | LOG_LOCAL0 |
Not available on Windows and Netware | |
$LOG_LOCAL1 | LOG_LOCAL1 |
Not available on Windows and Netware | |
$LOG_LOCAL2 | LOG_LOCAL2 |
Not available on Windows and Netware | |
$LOG_LOCAL3 | LOG_LOCAL3 |
Not available on Windows and Netware | |
$LOG_LOCAL4 | LOG_LOCAL4 |
Not available on Windows and Netware | |
$LOG_LOCAL5 | LOG_LOCAL5 |
Not available on Windows and Netware | |
$LOG_LOCAL6 | LOG_LOCAL6 |
Not available on Windows and Netware | |
$LOG_LOCAL7 | LOG_LOCAL7 |
Not available on Windows and Netware | |
$LOG_PID | LOG_PID |
||
$LOG_CONS | LOG_CONS |
||
$LOG_ODELAY | LOG_ODELAY |
||
$LOG_NDELAY | LOG_NDELAY |
||
$LOG_NOWAIT | LOG_NOWAIT |
Not available on BeOS | |
$LOG_PERROR | LOG_PERROR |
Not available on AIX |
Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
Examples
Example #1 define_syslog_variables() example
<?php
// Check if syslog variables already is defined
if(!get_cfg_var('define_syslog_variables'))
{
define_syslog_variables();
}
// Open the log
openlog('', $LOG_ODELAY, $LOG_MAIL | $LOG_USER);
// Continue script ...
?>
Changelog
Version | Description |
---|---|
5.3.0 | This function now throws an E_DEPRECATED notice. |
See Also
- openlog() - Open connection to system logger
- syslog() - Generate a system log message
- closelog() - Close connection to system logger
- checkdnsrr
- closelog
- define_syslog_variables
- dns_check_record
- dns_get_mx
- dns_get_record
- fsockopen
- gethostbyaddr
- gethostbyname
- gethostbynamel
- gethostname
- getmxrr
- getprotobyname
- getprotobynumber
- getservbyname
- getservbyport
- header_register_callback
- header_remove
- header
- headers_list
- headers_sent
- http_response_code
- inet_ntop
- inet_pton
- ip2long
- long2ip
- openlog
- pfsockopen
- setcookie
- setrawcookie
- socket_get_status
- socket_set_blocking
- socket_set_timeout
- syslog
Коментарии
define_syslog_variables() only defines global variables. Constants are already always defined, if the syslog module is loaded. You _do not_ need to call this to use the syslog constants.
For instance, on my system:
<?php
var_dump(LOG_ERR); // int(3)
var_dump($LOG_ERR); // NULL (and an E_NOTICE)
define_syslog_variables();
var_dump($LOG_ERR); // int(3)
?>