we are having some issues with the Outbound Webhook not getting invoked on Deal Update. Can someone advise how to enable log in Bitrix and check if there are any errors being thrown during Webhook call form Bitrix On-prem installation?
21 Answer
- Check in 'exception_handling' in file .settings.php
Example:
'exception_handling' => array ( 'value' => array ( 'debug' => false, // disables error output to screen // ошибки для вывода в лог 'handled_errors_types' => E_ALL & ~E_NOTICE & ~E_STRICT & ~E_WARNING, 'exception_errors_types' => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_COMPILE_WARNING, 'ignore_silence' => true, 'assertion_throws_exception' => true, 'assertion_error_type' => 256, 'log' => array ( 'settings' => array ( 'file' => "logs/bx_error/" . date("Y-m-d") . ".log", 'log_size' => 1000000, // ~ 1Mb per file ), ), ), 'readonly' => true, ), - You can log function to your hook.
Example:
function writeToLog($data, $title = '') { $log = "\n------------------------\n"; $log .= date("Y.m.d G:i:s") . "\n"; $log .= (strlen($title) > 0 ? $title : 'DEBUG') . "\n"; $log .= print_r($data, 1); $log .= "\n------------------------\n"; file_put_contents(getcwd() . '/hook.log', $log, FILE_APPEND); return true; }