(PHP 4, PHP 5)
define_syslog_variables — Initialisiert alle SysLog-bezogenen Variablen
Initialisiert alle Variablen, die in den SysLog-Funktionen Verwendung finden.
Es wird kein Wert zurückgegeben.
| Variable | Entsprechende Konstante | Bedeutung | Bemerkungen | 
|---|---|---|---|
| $LOG_EMERG | LOG_EMERG | System ist untauglich | |
| $LOG_ALERT | LOG_ALERT | Direktes Eingreifen erforderlich | |
| $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 in eine E-Mail | |
| $LOG_DAEMON | LOG_DAEMON | Andere Systemdienste | |
| $LOG_AUTH | LOG_AUTH | ||
| $LOG_SYSLOG | LOG_SYSLOG | Nicht für Netware verfügbar | |
| $LOG_LPR | LOG_LPR | ||
| $LOG_NEWS | LOG_NEWS | Usenet new | Nicht für HP-UX verfügbar | 
| $LOG_CRON | LOG_CRON | Auf keiner Plattform verfügbar | |
| $LOG_AUTHPRIV | LOG_AUTHPRIV | Nicht für AIX verfügbar | |
| $LOG_LOCAL0 | LOG_LOCAL0 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL1 | LOG_LOCAL1 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL2 | LOG_LOCAL2 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL3 | LOG_LOCAL3 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL4 | LOG_LOCAL4 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL5 | LOG_LOCAL5 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL6 | LOG_LOCAL6 | Nicht für Windows und Netware verfügbar | |
| $LOG_LOCAL7 | LOG_LOCAL7 | Nicht für Windows und Netware verfügbar | |
| $LOG_PID | LOG_PID | ||
| $LOG_CONS | LOG_CONS | ||
| $LOG_ODELAY | LOG_ODELAY | ||
| $LOG_NDELAY | LOG_NDELAY | ||
| $LOG_NOWAIT | LOG_NOWAIT | Nicht für BeOS verfügbar | |
| $LOG_PERROR | LOG_PERROR | Nicht für AIX verfügbar | 
Diese Funktion ist seit PHP 5.3.0 DEPRECATED (veraltet). Sich auf diese Funktion zu verlassen ist in keiner Weise empfehlenswert.
Beispiel #1 define_syslog_variables()-Beispiel
<?php
// Teste, ob die SysLog-Variablen bereits definiert wurden
if(!get_cfg_var('define_syslog_variables'))
{
    define_syslog_variables();
}
// Öffne das Log
openlog('', $LOG_ODELAY, $LOG_MAIL | $LOG_USER);
// Fahre weiter mit dem Skript fort ...
?>
| Version | Beschreibung | 
|---|---|
| 6.0.0 | Die Funktion wurde aus PHP entfernt. | 
| 5.3.0 | Die Funktion wirft jetzt eine E_DEPRECATED-Notice. | 
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)
?>