Commit 4042178a authored by MBoretto's avatar MBoretto

update README.md

parent 186c1592
...@@ -287,12 +287,20 @@ print_r($results); ...@@ -287,12 +287,20 @@ print_r($results);
### Logging ### Logging
Thrown Exception are stored in TelegramException.log file. Thrown Exception are stored in TelegramException.log file.
Incoming update can be logged on a text file, set this option with the methods: Incoming update (json string from webhook and getUpdates) can be logged on a text file, set those options with the methods:
```php ```php
$telegram->setLogRequests(true); $telegram->setLogRequests(true);
$telegram->setLogPath($BOT_NAME.'.log'); $telegram->setLogPath($BOT_NAME.'.log');
``` ```
(New!) Set verbosity to 3, to log also curl requests and responses from the bot to Telegram:
```php
$telegram->setLogRequests(true);
$telegram->setLogPath($BOT_NAME.'.log');
$telegram->setLogVerbosity(3);
```
----- -----
This code is available on This code is available on
[Github](https://github.com/akalongman/php-telegram-bot). Pull [Github](https://github.com/akalongman/php-telegram-bot). Pull
......
...@@ -25,7 +25,7 @@ try { ...@@ -25,7 +25,7 @@ try {
//$telegram->setCommandConfig('date', array('google_api_key'=>'your_google_api_key_here')); //$telegram->setCommandConfig('date', array('google_api_key'=>'your_google_api_key_here'));
//$telegram->setLogRequests(true); //$telegram->setLogRequests(true);
//$telegram->setLogPath($BOT_NAME.'.log'); //$telegram->setLogPath($BOT_NAME.'.log');
//$telegram->setLogVerbosity(3);
// handle telegram getUpdate request // handle telegram getUpdate request
$telegram->handleGetUpdates(); $telegram->handleGetUpdates();
......
...@@ -21,7 +21,7 @@ try { ...@@ -21,7 +21,7 @@ try {
//$telegram->setCommandConfig('date', array('google_api_key'=>'your_google_api_key_here')); //$telegram->setCommandConfig('date', array('google_api_key'=>'your_google_api_key_here'));
//$telegram->setLogRequests(true); //$telegram->setLogRequests(true);
//$telegram->setLogPath($BOT_NAME.'.log'); //$telegram->setLogPath($BOT_NAME.'.log');
//$telegram->setLogVerbosity(4);
// handle telegram webhook request // handle telegram webhook request
$telegram->handle(); $telegram->handle();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment