Where does Bitrix generates logs?

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?

2

1 Answer

  1. 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, ), 
  1. 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; } 

Document reference:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like