2017-06-13 50 views
0

我不想將Rollbar集成到我的cakephp項目中,但我不知道在我的應用程序中包含引用rolbar的代碼的位置? 我有使用此代碼將rollbar集成到我的Cakephp項目中

<?php 
use \Rollbar\Rollbar; 

// Installs global error and exception handlers 
$config = array(
    // required 
    'access_token' => 'MY_ACCESS_TOKEN', 
    // optional - environment name 
    'environment' => 'production', 
); 
Rollbar::init($config); 

但它僅適用於我已添加到頁面,所以請幫助我如何能配置CakePHP程序翻車防護杆。

+1

嘿Wajdi - 得到幫助瓦特/翻車防護杆的PHP的最佳方法是在https://github.com/rollbar創建一個問題/翻車的PHP /的問題。我們的工程師直接對這些門票作出迴應,並可以幫助您。 –

+0

@JesseGibbs謝謝,問題解決了。 –

回答

0

我應該把這個代碼在bootstrap.php中

use \Rollbar\Rollbar; 

// Installs global error and exception handlers 
$config = array(
    // required 
    'access_token' => 'ACCESS_TOKEN', 
    // optional - environment name 
    'environment' => 'production', 
    // optional - path to directory your code is in. Used for linking stack traces. 
    'root' => '/Users/brian/www/myapp' 
); 
Rollbar::init($config);