2017-06-13 51 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);