PHP.nl

error_log

error_log

Send an error message to the defined error handling routines

bool **error_log** string $message int $message_type  $destination  $additional_headers

Sends an error message to the web server's error log or to a file.

messageThe error message that should be logged.

message_typeSays where the error should go. The possible message types are as follows:

destination The destination. Its meaning depends on the parameter as described above. message_type

additional_headers The extra headers. It's used when the parameter is set to . This message type uses the same internal function as does. message_type``1``mail

return.success If is zero, this function always returns true, regardless of whether the error could be logged or not. message_type

Voorbeeld: examples

<?php
// Send notification through the server log if we can not
// connect to the database.
if (!Ora_Logon($username, $password)) {
    error_log("Oracle database not available!", 0);
}

// Notify administrator by email if we run out of FOO
if (!($foo = allocate_new_foo())) {
    error_log("Big trouble, we're all out of FOOs!", 1,
               "operator@example.com");
}

// another way to call error_log():
error_log("You messed up!", 3, "/var/tmp/my-errors.log");
?>

Waarschuwing: > is not binary safe. will be truncated by null character. error_log``message

Tip: > should not contain null character. Note that may be sent to file, mail, syslog, etc. Use appropriate conversion/escape function, , or before calling . message``message``base64_encode``rawurlencode``addslashes``error_log