PHP त्रुटि_लॉग () फ़ंक्शन
उदाहरण
वेब सर्वर के त्रुटि लॉग और मेल खाते में त्रुटि संदेश भेजें:
<?php
// Send error message to the server log if error connecting to the database
if (!mysqli_connect("localhost","bad_user","bad_password","my_db")) {
error_log("Failed to connect to database!", 0);
}
// Send email to administrator if we run out of FOO
if (!($foo = allocate_new_foo())) {
error_log("Oh no! We are out of FOOs!", 1, "[email protected]");
}
?>
परिभाषा और उपयोग
error_log() फ़ंक्शन लॉग में, फ़ाइल में, या मेल खाते में एक त्रुटि संदेश भेजता है।
वाक्य - विन्यास
error_log(message, type, destination, headers);
पैरामीटर मान
Parameter | Description |
---|---|
message | Required. Specifies the error message to log |
type | Optional. Specifies where the error message should go.
Possible values:
|
destination | Optional. Specifies the destination of the error message. This value depends on the value of the type parameter |
headers | Optional. Only used if the type parameter is set to 1. Specifies additional headers, like From, Cc, and Bcc. Multiple headers should be separated with a CRLF (\r\n) |
टेक्निकल डिटेल
प्रतिलाभ की मात्रा: | सफलता पर सच। विफलता पर FALSE |
---|---|
पीएचपी संस्करण: | 4.0+ |
बाइनरी सुरक्षित: | नहीं |
पीएचपी चेंजलॉग: | PHP 5.2.7: प्रकार पैरामीटर में 4 का मान जोड़ा गया था |
पीएचपी त्रुटि संदर्भ