(PECL seaslog >=1.0.0)
SeasLog::getRequestID — 取得 SeasLog request_id 區分請求
為了區分單個請求,例如未呼叫 SeasLog::setRequestId() 函式,在請求初始化時會使用內建 `static char *get_uniqid ()` 函式產生的唯一值。
此函式沒有參數。
回傳由內建 `static char *get_uniqid ()` 函式產生的字串,或由 SeasLog::setRequestId() 函式設定的值。
範例 #1 SeasLog::getRequestID() 範例
<?php
var_dump(SeasLog::getRequestID());
var_dump(SeasLog::setRequestID('reqeust_id_test_'.time()));
var_dump(SeasLog::getRequestID());
?>
上述範例將輸出類似以下的內容:
string(13) "5b3f21a209519" bool(true) string(26) "reqeust_id_test_1530864034"