Giter Site home page Giter Site logo

yiisoft / yii2-debug Goto Github PK

View Code? Open in Web Editor NEW
200.0 31.0 149.0 10.75 MB

Debug Extension for Yii 2

Home Page: http://www.yiiframework.com

License: BSD 3-Clause "New" or "Revised" License

PHP 52.98% JavaScript 5.04% Shell 0.02% SCSS 41.96%
yii yii2 debugger profiler logging debugger-toolbar hacktoberfest

yii2-debug's Introduction

Debug Extension for Yii 2


This extension provides a debugger for Yii framework 2.0 applications. When this extension is used, a debugger toolbar will appear at the bottom of every page. The extension also provides a set of standalone pages to display more detailed debug information.

For license information check the LICENSE-file.

Documentation is at docs/guide/README.md.

Latest Stable Version Total Downloads Build Status

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiisoft/yii2-debug

or add

"yiisoft/yii2-debug": "~2.1.0"

to the require section of your composer.json file.

Usage

Once the extension is installed, simply modify your application configuration as follows:

return [
    'bootstrap' => ['debug'],
    'modules' => [
        'debug' => [
            'class' => 'yii\debug\Module',
            // uncomment and adjust the following to add your IP if you are not connecting from localhost.
            //'allowedIPs' => ['127.0.0.1', '::1'],
        ],
        // ...
    ],
    ...
];

You will see a debugger toolbar showing at the bottom of every page of your application. You can click on the toolbar to see more detailed debug information.

Open Files in IDE

You can create a link to open files in your favorite IDE with this configuration:

return [
    'bootstrap' => ['debug'],
    'modules' => [
        'debug' => [
            'class' => 'yii\debug\Module',
            'traceLine' => '<a href="phpstorm://open?url={file}&line={line}">{file}:{line}</a>',
            // uncomment and adjust the following to add your IP if you are not connecting from localhost.
            //'allowedIPs' => ['127.0.0.1', '::1'],
        ],
        // ...
    ],
    ...
];

You must make some changes to your OS. See these examples:

Virtualized or dockerized

If your application is run under a virtualized or dockerized environment, it is often the case that the application's base path is different inside of the virtual machine or container than on your host machine. For the links work in those situations, you can configure tracePathMappings like this (change the path to your app):

'tracePathMappings' => [
    '/app' => '/path/to/your/app',
],

Or you can create a callback for traceLine for even more control:

'traceLine' => function($options, $panel) {
    $filePath = $options['file'];
    if (StringHelper::startsWith($filePath, Yii::$app->basePath)) {
        $filePath = '/path/to/your/app' . substr($filePath, strlen(Yii::$app->basePath));
    }
    return strtr('<a href="ide://open?url=file://{file}&line={line}">{text}</a>', ['{file}' => $filePath]);
},

yii2-debug's People

Contributors

bwoester avatar cebe avatar creocoder avatar crtlib avatar dynasource avatar egorpromo avatar gevik avatar gonimar avatar kartik-v avatar klimov-paul avatar larryullman avatar lucianobaraglia avatar machour avatar mohorev avatar pana1990 avatar pmoust avatar qiangxue avatar ragazzo avatar resurtm avatar rhertogh avatar samdark avatar sarke avatar schmunk42 avatar sensorario avatar silverfire avatar slavcodev avatar softark avatar suralc avatar tarasio avatar tonydspaniard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-debug's Issues

New EXPLAIN feature breaks db debug when no 'db' component setup

My scenario is such that my application uses 3 different database components, however I do not call any of these database components 'db'. When I click to go to the db panel of the debug module, I am presented with Unknown component ID: db

I also haven't tested it but I'm not sure how the new explain feature would work if you did have multiple databases and queried multiple databases. It seems like you could only have explains for a single database or you would have to somehow create multiple panels for each and it wouldn't make any sense to try and run an explain for a query from "DatabaseA" on "DatabaseB" or vice versa. Perhaps i'm overlooking something here though?

Serialization of Exceptions doesn't work

When throwing an Exception with enabled debugging the logpanel doesn't show up and i get the following error:

2015-11-27 21:11:05 [::1][100][t36rsoef0lofi3g867aadfmgd0][warning][yii\log\Dispatcher::dispatch] Unable to send log via yii\debug\LogTarget: Exception 'PDOException' with message 'You cannot serialize or unserialize PDO instances' 

in [...]\yii\vendor\yiisoft\yii2-debug\LogTarget.php:58

This yiisoft/yii2#9632 issue could be related.

debug with restful app

This is my simple urlManager configure:

[
    'enablePrettyUrl' => true,
    'enableStrictParsing' => true,
    'showScriptName' => false,
    'suffix' => '.json',
    'ruleConfig' => [
        'class' => 'yii\rest\UrlRule',
    ],
    'rules' => [
        [
            'controller' => ['v1/user', 'site'],
        ],
    ],
];

I configured the UrlManager::ruleConfig. When using yii2-debug there will be an exception throw.

Setting unknown property: yii\rest\UrlRule::route

Debug-Toolbar replaced by Page Content

Hi,

I have Debug enabled if SERVER_ADDR is 127.0.0.1

In my setup form (for create first user of website) i have no additional JS / CSS loaded and existing JS / CSS not edited.

Now, if debug enabled, i have my page twice rendered instead of Page + Debug-Toolbar (see attached image)
ss 2015-04-03 at 10 55 33

My Page Source is correct and i would not know which content could cause this behavior.
As reference i have pasted my source from browser to pastebin:
http://pastebin.com/xfHcMXKi

I hope you could help out with tipps - or is this a bug i hope youll find them fast and can resolve them.

Additional Information:
Im using an own template engine. This engine is feeded with variables in form of array and replace placeholders by array value. This should not cause any issue since the output is the same as yii would produce (I have the same issue if i dont use my templater).

Greetings, Kai Bรถse

New infos by Config Panel

I would like to see any power configuration panel modules List registered one .

As if it were the Listing of installed extensions existing , showing module name and the path to it.

Sorting of debug data

Probably the biggest motivator (not the only) to access the debug panel is to track the execution of the application, step by step.

What is the opinion of you on making the time column as default sorting in all panels?

add Modules

It is nice to add a Modules section like Installed Extensions, in yii debug configuration

Debugger doesn't load when there is a closure in Yii::trace

This issue has originally been reported by @guidebin at yiisoft/yii2#8550.
Moved here by @cebe.


The debug view wasn't loading and it took me a while to figure out why. In the log it was showing:

[warning][yii\log\Dispatcher::dispatch] Unable to send log via yii\debug\LogTarget: Exception 'Exception' with message 'Serialization of 'Closure' is not allowed'

I finally found out it was caused by using Yii::trace with a closure, removing the trace call fixed it. Looks like the same issue as #5402, which was fixed previously.

debug module events panel

This issue has originally been reported by @Ragazzo at yiisoft/yii2#3842.
Moved here by @cebe.


Usually when creating application and using EDA or SOA it is good to have ability to check events and data that they hold.
I think this panel would be useful in debug module, several modern fw also includes it.

The only thing here we have to solve is how to subscribe to all or part of events, since we dont have wildcard matching and we dont have any central point for event. My suggestion is to either add wildcard matching or introduce in events panel property neededEvents in format:

'neededEvents' => [
     'some\component\class' => [
          //list of events to subscribe
     ],
],

In the same way we can make exclude option. Data that will be collected upon each event is its public properties json encoded or we can use Yii2 var_export not sure about the last one though .

hhvm&nginx duplicate response headers

While using debug module with hhvm & nginx i'm getting duplicate response headers

Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Pragma:no-cache

The reason is RequestPanel which executes Yii::$app->get('session') for logging flash messages.
I'm not sure where is the actual reason for such behavior but after commenting out 'flashes' => $this->getFlashes(), from the save()'s return statement - headers has no duplicates.

Duration added to log

duration should be added to the logs panel. This is extremely useful and should not be avaiable for performance only.

Profiling could be more informative

This issue has originally been reported by @SDKiller at yiisoft/yii2#7617.
Moved here by @cebe.


As of now:

   ...
     * @param string $token token for the code block
     * @param string $category the category of this log message
     * @see endProfile()
     */
    public static function beginProfile($token, $category = 'application')
    {
        static::getLogger()->log($token, Logger::LEVEL_PROFILE_BEGIN, $category);
    }

The same is for endProfile.
Here $token is just a key to match the corresponding beginProfile and endProfile records.

But for logger $token is message, which can be

 * @param string|array $message the message to be logged. This can be a simple string or a more
 * complex data structure that will be handled by a [[Target|log target]].

When profiling you could wish (and usually it is nesessary) to save additional information related to it - for example object state (often - both for begin and end of profiling).

Of course you can immediately log this info as separate record using log(), but:

  1. later you'll have to seek for log records corresponding to this profiling record to retrieve this info;
  2. its additional overhead which will affect profile timing
  3. object which properties you want to pass as additional info may change between profile and log records, so you need to introduce additional variables to save it state at the moment of profiling to be sure that proper values will be logged;
  4. its additional code.

Could be useful if beginProfile and endProfile could accept the same format as log() (finally - they are just proxy functions for log()).

Formally passing array to beginProfile and endProfile is possible, but is actually restricted by \yii\log\Logger::calculateTimings - as it treats $token only as string for comparison.

For logging there is no problem as \yii\log\Target::formatMessage processes non-string messages by VarDumper::export

IMO - \yii\log\Logger::calculateTimings could be modified.

If $token was passed as string - left as is.
If as array - their could be a constant, a naming convention or configuration parameter for token array key, and the rest of the message could be processed by VarDumper::export

Show more depth total memory

Currently, memory is set to 1 decimal only. Most of the addons/changes I do are to be measured in at least 2 decimals.

Therefore I would suggest to show more dept, ie. 10.15MB instead of 10.1MB

HTML/CSS: Remove container class in view files

I have been working with the debug class for a year now and its an excellent tool. One thing that makes the use less practical though, is the restriction of the width of a view with a bootstrap 'container' class.

Ive tried to understand the logic & use behind it, but cant find a reason why the width of the view is restricted. Many queries and other reports are broken in the tables because of the small width. Especially with reports & logs you want to benefit from your own big screen, and now its limited to max 1200px.

It is an idea to remove the container classes?

Another debug data storage support

We want to use this extension in our staging zone, but the problem is that we have multiple application servers behind balancing server. We tried to extend this module, but we needed to extend 3 different classes:

  1. Module (LogTarget forcing on application start)
  2. LogTarget (File saving)
  3. DefaultController (Information fetching from file)

This issue may be fixed with using a storage class with get, set, getManifest and setManifest methods or something like this. We want to use Redis for this task. What do you think?
I can implement this in PR

Improve accuracy timing

What is currently covered in the log of the toolbar is:

  • the lifecycle after loading the config files.

What is also useful is to provide an actual timeframe which corresponds with the total time displayed in the toolbar in which you get a accurate display of the total request. This requires a log of the:

  • start time of app
  • end time of app

Backport enhancements made in Debug panel for Yii 1.1

Debug panel for Yii 1.1 implemented by @zhuravljov is an excellent port of 2.0 panel with some cool additions and changes we can port back.

Toolbar

Here's current 2.0 toolbar:

yii2_debug_toolbar

And here's 1.1 toolbar:

yii_11_debug_toolbar

We could remove "Yii Debugger" title and place version number w/o "Yii" there. Will save lots of space for custom panels. done

Index

Current:

yii2_debug_index

1.1:

yii_11_debug_index

Status code could be highlighted, dates could be formatted better. done

The stars there are to "pin" a request so it's never cleaned up when debug data limit is reached. These are also in request page:

yii_11_debug_pinning

DB panel

yii_11_debug_db

yii_11_debug_db_summary

yii_11_debug_db_connections

  1. Syntax highlighting yiisoft/yii2#52
  2. Ability to run EXPLAIN in place. done
  3. Resume (should be called summary) tab shows how many queries of the same type were made, ordering such query groups by execution time descending. Very useful for getting an idea of what could be optimized.
  4. Connections tab shows which connections were made.

Version 2.0.5

Should the composer package yiisoft/yii2-debug not also be available as version 2.0.5?

(edit: otherwise i do have all those different versions on each package.)

Got error at LogTarget.php line 137 with codeception unittest

Hi, I run codeception unit test and got this error print while my test result was still fine.

Unit Tests (1) -----------------------------------------------------------------------------------------------------------------------------
Test validation (tests\codeception\unit\modules\mymodule\models\MyModelTest::testValidation)                                   Ok
--------------------------------------------------------------------------------------------------------------------------------------------


Time: 95 ms, Memory: 15.50Mb

OK (1 test, 2 assertions)
PHP Fatal error:  Call to a member function getRequest() on a non-object in /path/to/my/vendor/yiisoft/yii2-debug/LogTarget.php on line 137
PHP Stack trace:
PHP   1. {main}() /path/to/.composer/vendor/codeception/codeception/codecept:0
PHP   2. Symfony\Component\Console\Application->run() /path/to/.composer/vendor/codeception/codeception/codecept:27
PHP   3. yii\log\Logger->flush() /path/to/my/vendor/yiisoft/yii2/log/Logger.php:0
PHP   4. yii\log\Dispatcher->dispatch() /path/to/my/vendor/yiisoft/yii2/log/Logger.php:170
PHP   5. yii\debug\LogTarget->collect() /path/to/my/vendor/yiisoft/yii2/log/Dispatcher.php:183
PHP   6. yii\debug\LogTarget->export() /path/to/my/vendor/yiisoft/yii2-debug/LogTarget.php:112
PHP   7. yii\debug\LogTarget->collectSummary() /path/to/my/vendor/yiisoft/yii2-debug/LogTarget.php:51

SQL query count summary

Add summary tab that shows how many queries of the same type were made, ordering such query groups by execution time descending. Very useful for getting an idea of what could be optimized.

Extend toolbar with POST 302 data

When a page has issues/errors during a Post + 302, you cannot see this in the updated toolbar. I would like to see this somehow because its valuable information you dont see.

I would like to eloborate on a solution for this. It could be done by either:

  • add extra row to toolbar with the POST 302
  • add dropdown with last 10 pages
  • other ideas?

Debug toolbar is not shown on PHP errors

This issue has originally been reported by @cebe at yiisoft/yii2#7616.
Moved here by @cebe.


The problem is that ErrorHandler does not use application view in this case:
https://github.com/yiisoft/yii2/blob/master/framework/web/ErrorHandler.php#L220

But toolbar is only rendered on view end body event:
https://github.com/yiisoft/yii2/blob/master/extensions/debug/Module.php#L122

@samdark do you remember why app view is not used on PHP error?

We might fix this by adding a similar event to the errorhandler.

Second request to "/debug/default/index"

This issue has originally been reported by @kmergen at yiisoft/yii2#11034.
Moved here by @samdark.


Working on basic app version yii2 dev.
If I load a page always a second request to debug/default/index is fired with a long timeline (10 s).
chrome says the initiator is the ajax function in debug script

image

if (toolbarEl) {
        url = toolbarEl.getAttribute('data-url');

        ajax(url, {
            success: function (xhr) {
                div = document.createElement('div');
                div.innerHTML = xhr.responseText;

                toolbarEl.parentNode.replaceChild(div, toolbarEl);

                showToolbar(findToolbar());
            },
            error: function (xhr) {
                toolbarEl.innerHTML = xhr.responseText;
            }
        });
    }

Here's what I've tried but without success

  • install stable yii2 2.0.7,
  • no theme
  • delete whole runtime folders
  • switch from db to file cache

Here my composer.json

{
    "name": "yii2-basic-starter",
    "description": "An extended Yii 2 Basic Project Template",
    "keywords": ["yii2", "framework", "basic", "project template"],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "dev",
    "require": {
        "php": ">=5.4.0",
        "yiisoft/yii2": ">=2.0.5",
        "yiisoft/yii2-bootstrap": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-imagine": "*",
        "dektrium/yii2-user": "0.9.*@dev",
        "rmrevin/yii2-fontawesome": "~2.9",
        "bower-asset/blueimp-file-upload": "~9.9.0",
        "perminder-klair/yii2-dropzone": "dev-master",
        "2amigos/yii2-file-upload-widget": "~1.0"
    },
    "require-dev": {
        "yiisoft/yii2-codeception": "*",
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "*",
        "yiisoft/yii2-faker": "*"
    },
    "config": {
        "process-timeout": 1800
    },
    "scripts": {
        "post-install-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ],
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject"
        ]
    },
    "extra": {
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0777",
                    "web/assets": "0777",
                    "yii": "0755"
                }
            ],
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        },
        "asset-installer-paths": {
            "npm-asset-library": "vendor/npm",
            "bower-asset-library": "vendor/bower"
        }
    }
}

Here my main config

<?php
$params = require(__DIR__ . '/params.php');

$config = [
    'id' => 'basic-starter',
    'basePath' => dirname(__DIR__),
    'bootstrap' => ['log'],
    'language' => 'de-De',
    'sourceLanguage' => 'en-US',
    'components' => [
        'request' => [
            // !!! insert a secret key in the following (if it is empty) - this is required by cookie validation
            'cookieValidationKey' => 'L8KaplYpqPFlZv-B-G60X3nb3W-t34k7',
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'authManager' => [
            'class' => 'yii\rbac\DbManager'
        ],
        'errorHandler' => [
            'errorAction' => 'site/error',
        ],
        'mailer' => [
            'class' => 'yii\swiftmailer\Mailer',
            // send all mails to a file by default. You have to set
            // 'useFileTransport' to false and configure a transport
            // for the mailer to send real emails.
            'useFileTransport' => true,
        ],
        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
            ],
        ],
        'image' => [
            'class' => 'app\components\image'
        ],
        'assetManager' => [
            'linkAssets' => false,
            'forceCopy' => YII_DEBUG ? true : true,
            'bundles' => [
                'yii\web\JqueryAsset' => [
                    'sourcePath' => null,
                    'js' => [
                        '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js',
                    ],
                ],
            ],
        ],
        'urlManager' => [
            'class' => 'yii\web\UrlManager',
            // Disable index.php
            'showScriptName' => false,
            // Disable r= routes
            'enablePrettyUrl' => true,
            'cache' => null,
            'rules' => [
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ],
        ],
        'i18n' => [
            'translations' => [
                'app*' => [
                    'class' => 'yii\i18n\PhpMessageSource',
                    'basePath' => '@app/messages',
                ],
            ],
        ],
        'view' => [
            'theme' => [
                'basePath' => '@app/themes/basic',
                //'baseUrl' => '@web/themes/basic',
                'pathMap' => [
                  //  '@app/views' => '@app/themes/basic/views',
                    '@app/modules/backend/views' => '@app/themes/adminlte/views',
                    '@dektrium/user/views' => '@app/themes/adminlte/views/user',
                ],
            ],
        ],
        'db' => require(__DIR__ . '/db.php'),
    ],
    'modules' => require(__DIR__ . '/modules.php'),
    'params' => $params,
];

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
    ];
}

return $config;

Console application and debug module

I've found intresting thing and i want to recognze it is bug or i just use debug module in wring way.
I use common config for web and console application and when i execute someting console command i get the error

Calling unknown method: yii\console\Request::getUserIP()
Calling unknown method: yii\console\Request::getIsAjax()

If it is available to use debug module in console application we have to check request instance that why only yii\web\Request has method getUserIP and others which base on http request.

One of the places where the error occurres: https://github.com/yiisoft/yii2-debug/blob/master/Module.php#L201

Check for Yii version

We could do it the same way as Symfony:

16600815414_50ea65e5c7_o

i.e. if there's internet connection, get to yiiframework.com API which provides framework versions list and verify if currently using version is OK.

DB Queries listed in wrong order

I found, that DB queries are not sorted correctly by their time of execution. This is very confusing during debugging. I'd expect to see the queries listed in the order they where executed.

debug_toolbar_sorting

I'm using latest release (2.0.5).

Quoted DB expression when used in param

This issue has originally been reported by @klevron at yiisoft/yii2#6382.
Moved here by @cebe.


Hello

DB Expression is quoted when used in param, e.g.

MyModel::deleteAll("expire < :expire", [':expire' => new Expression('NOW()')]);

This will make the following query :

DELETE FROM `expire` WHERE expire < 'NOW()';

Be careful, debug tool will log the correct one :

DELETE FROM `expire` WHERE expire < NOW();

http://stackoverflow.com/questions/27312579/odd-behavior-of-now-and-db-expression-in-yii2-mysql

[ENH] Navigation ajax

When i click option in menu i would like render by ajax instead of refresh all page. GridView should be rendering ajax (sort and search ) too.

screenshot_1

Problem with toolbar when catchAll is set

When yii\web\Application::$catchAll is set, debug toolbar will be rendered as "maintenance" page, so you will see content of that page rendered twice.
I suggest to disable debug toolbar when this application property is set.

Using the debugger in production, usage with other targets

Hi. So I've been using the debugger in production, and I think it is really helpful. I was wondering, is it a good idea to use it in production? Is the performance impact minimum? I did some timings, but it seems that the requests are processed just as fast. I see the Yii guide for performance tuning recommends disabling the debug environment, as that decreases performance, but does it refer to this "Debugger Module` too?

Also, when using cloud computing, like Amazon Web Services, when the server load increases the server might scale up, so you get more servers. This means that, when trying to access the debugger, sometimes you get 10 items, sometimes you get 100, because the requests go to different servers, and the debugger data is stored on each server.

This is a bit hard to handle and I was wondering of the debugger supports other targets, like a database target?
Thanks.

yii2-debug has bug?

This issue has originally been reported by @xjdata at yiisoft/yii2#10873.
Moved here by @samdark.


when i click
http://localhost/debug/default/view?panel=log&tag=56c3874981625&panel=log
or
http://localhost/debug/default/view?panel=log&tag=56c3874981625&panel=mail
Yii Framework/2.0.7

PHP Notice โ€“ yii\base\ErrorException

Undefined index: id

1. in /data/wwwroot/web/vendor/yiisoft/yii2/data/Sort.php at line 213
* @param boolean $recalculate whether to recalculate the sort directions
     * @return array the columns (keys) and their corresponding sort directions (values).
     * This can be passed to [[\yii\db\Query::orderBy()]] to construct a DB query.
     */
    public function getOrders($recalculate = false)
    {
        $attributeOrders = $this->getAttributeOrders($recalculate);
        $orders = [];
        foreach ($attributeOrders as $attribute => $direction) {
            $definition = $this->attributes[$attribute];
            $columns = $definition[$direction === SORT_ASC ? 'asc' : 'desc'];
            foreach ($columns as $name => $dir) {
                $orders[$name] = $dir;
            }
        }

        return $orders;
    }

i don't edit any files of path /data/wwwroot/web/vendor/yiisoft/

i try rm -rf /vendor/* && clear composer all cachefile && composer update.

still error

but

http://localhost/debug/default/view?panel=log&tag=56c3874981625&panel=config // /request/profiling/db/assets

it's work fine

debug toolbar not showing if defined email target in addition to file target

I have the following configuration

  'log' => [
            'traceLevel' => YII_DEBUG ? 0 : 3,
            'targets' => [
                'file' => [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning'],
                ],
                'email' => [
                    'class' => 'yii\log\EmailTarget',
                    'levels' => ['error', 'warning'],
                    'message' => [
                        'to' => ['[email protected]'],
                        'subject' => 'Frontend log',
                    ],
                ],

            ],
        ],

Debug toolbar not showing but if i removed the email section it's showing.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.