PHP openlog()ฟังก์ชั่น
ตัวอย่าง
เปิดและปิดการเชื่อมต่อของตัวบันทึกระบบ:
<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>
ความหมายและการใช้งาน
ฟังก์ชัน openlog() จะเปิดการเชื่อมต่อของตัวบันทึกระบบ
ไวยากรณ์
openlog(ident, option, facility)
ค่าพารามิเตอร์
Parameter | Description |
---|---|
ident | Required. Specifies a string ident that is added to each message |
option | Required. Specifies what logging options will be used when generating a
log message. Can be one or more of the following options (separated with |):
|
facility | Required. Specifies what type of program is logging the message:
|
รายละเอียดทางเทคนิค
คืนมูลค่า: | จริงกับความสำเร็จ เท็จเมื่อล้มเหลว |
---|---|
รุ่น PHP: | 4.0+ |
❮ การอ้างอิงเครือข่าย PHP