PHP error_log() လုပ်ဆောင်ချက်
ဥပမာ
ဝဘ်ဆာဗာ၏ အမှားမှတ်တမ်းနှင့် မေးလ်အကောင့်သို့ အမှားအယွင်းစာတိုများ ပေးပို့ပါ-
<?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) |
နည်းပညာဆိုင်ရာအသေးစိတ်
ပြန်ပို့တန်ဖိုး- | အောင်မြင်မှုအပေါ် သစ္စာရှိပါ။ ရှုံးနိမ့်မှုအပေါ် မှားသည်။ |
---|---|
PHP ဗားရှင်း- | 4.0+ |
Binary Safe- | မရှိ |
PHP Changelog- | PHP 5.2.7- 4 တန်ဖိုးကို အမျိုးအစား ကန့် သတ် ဘောင်သို့ ထည့်ထားသည်။ |
PHP Error ကိုးကား