Closed Sogl closed 8 years ago
Log are not inteded to store variable so far. I suggest you to exploit getUpdates.php to develop where you can print vars. When everything works move to webhook.
I debug custom POST request to webhook through the Postman (Google APP), send JSON with a settings and applay with php xdebug.
You can also just use the static Logger::logException
method for now.
(When Monolog is merged into develop, then you can use that)
Logger::initialize('filename.log');
Logger::logException($whats_in_me);
@Monster3D Can you add some Postman JSON examples? I'm already have configured xdebug with my ide_key
.
@Sogl i used this JSON
{
"update_id":160070181,
"message":{
"message_id":181,
"from":{
"id":91535236,
"first_name":"\u041d\u0438\u043a\u043e\u043b\u0430\u0439",
"last_name":"\u0411\u0430\u0435\u0432",
"username":"NikolayBaev"},"chat":{
"id":00000000000,
"first_name":"\u041d\u0438\u043a\u043e\u043b\u0430\u0439",
"last_name":"\u0411\u0430\u0435\u0432",
"username":"NikolayBaev",
"type":"private"
},
"date":1459232407,
"text":"\/help"
}
}
where 000000000, my chat ID. send this request to local server. (use http POST request) my link: telegram.loc/telegrambot/hook?XDEBUG_SESSION_START=PHPSTORM
Hello!
How to debug commands using webhook? Logging enabled:
But I want to see php variables in output. How can I add vars to
*.log
?