Warning: include(../lntop.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 19

Warning: include() [function.include]: Failed opening '../lntop.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 19

Warning: include(../levoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 46

Warning: include() [function.include]: Failed opening '../levoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 46



Учебник РНР
Назад Вперёд

error_log

(PHP 3, PHP 4)

error_log - высылает сообщение об ошибке.

Описание

int error_log (string message [, int message_type [, string destination [, string extra_headers]]])

Высылает сообщение об ошибке в error log web-сервера, TCP -порт или в файл. Первый параметр message это сообщение об ошибке, которое должно быть записано в лог-файл. Второй параметр, message_type, говорит, куда сообщение должно быть направлено:

Таблица 1. Типы error_log()
0message высылается в системный логер РНР, используя механизм логинга ОС, или в файл, в зависимости от установки директивы конфигурации error_log.
1message высылается по email по адресу в параметре destination. Это единственный тип сообщения с 4 параметром, extra_headers. Этот тип сообщений использует ту же внутреннюю функцию, что и mail().
2message высылается через соединение отладки РНР. Эта опция доступна, только если включена опция удалённой отладки. В этом случае параметр destination специфицирует имя хоста или IP-адрес, или - по выбору - номер порта сокета, получающего отладочную информацию.
3message присоединяется к файлу destination.
 
Предупреждение!

Удалённая отладка по TCP/IP это возможность PHP 3, которая недоступна в PHP 4.

Пример 1. error_log()
// отправляет уведомление через log сервера, если мы на можем
// соединиться с БД.
if (!Ora_Logon ($username, $password)) {
    error_log ("Oracle database not available!", 0);
}

// Администратор уведомляется по email, если мы работаем вне FOO
if (!($foo = allocate_new_foo()) {
    error_log ("Big trouble, we're all out of FOOs!", 1,
               "operator@mydomain.com");
}

// другие способы вызова error_log():
error_log ("You messed up!", 2, "127.0.0.1:7000");
error_log ("You messed up!", 2, "loghost");
error_log ("You messed up!", 3, "/var/tmp/my-errors.log");

НазадОглавление Вперёд
Функции обработки ошибок и логинга Вверхerror_reporting


Warning: include(../pravoe_menu.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 169

Warning: include() [function.include]: Failed opening '../pravoe_menu.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 169

Rambler's Top100
© 2009 Тест скорости интернета |  Boont.Ru

Warning: include(../lnbottom.php) [function.include]: failed to open stream: No such file or directory in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 295

Warning: include() [function.include]: Failed opening '../lnbottom.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/prime/data/www/prime-speed.ru/Manual_PHP_4/f/error-log.html on line 295