1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > php启用日志记录 PHP SDK启用日志功能报错

php启用日志记录 PHP SDK启用日志功能报错

时间:2021-05-13 05:43:03

相关推荐

php启用日志记录 PHP SDK启用日志功能报错

namespace App\Http\Controllers\Dueros;

use Baidu\Duer\Botsdk\Bot as DuerosBot;

class Bot extends DuerosBot

{

public function __construct($postData = [])

{

parent::__construct($postData);

// 日志配置 日志报错了

$this->log = new \Baidu\Duer\Botsdk\Log([

//日志存储路径

'path' => storage_path('app') . "\logs",

'level' => \Baidu\Duer\Botsdk\Log::NOTICE,

]);

// 记录这次请求

$requestJson = json_encode($this->request->getData());

$this->log->setField('[logid]',$this->request->getLogId());

$this->log->setField('[request]',$requestJson);

$this->addLaunchHandler(function () {

return [

'card' => null,

'outputSpeech' => 'Hello, 欢迎使用智能设备语音控制系统',

'directives' => [],

'resource' => null,

'reprompt' => null,

];

});

}

}

[-12-17 01:42:01] local.ERROR: Undefined index: HTTP_SAIYALOGID {"exception":"[object] (ErrorException(code: 0): Undefined index: HTTP_SAIYALOGID

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。