Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chrome 50 displaying duplicate log entries #64

Open
richardwo opened this issue Apr 27, 2016 · 10 comments
Open

Chrome 50 displaying duplicate log entries #64

richardwo opened this issue Apr 27, 2016 · 10 comments

Comments

@richardwo
Copy link

Using Chrome 50 on OS X 10.11.4 duplicate entries are displayed for each server side log command.
I've checked on the server (PHP) and it is only sending one header for each log command.

@hlev
Copy link

hlev commented Jul 12, 2016

Same here with Chrome 51 64bit.
On one occasion the console was reporting an entry as being output by chrome-extension://noaneddfkdjfnfdakjjmocngnfkfehhd which is Chrome Logger, and the duplicate entry by something called "VM64extension..." which looked internal to Chrome (?). I could not make the dev tools print that again, it must have been a coincidence. It always groups the duplicates and makes it look like as if both came from Chrome Logger.

@AndreKR
Copy link

AndreKR commented Aug 27, 2016

It seems to happen only if the response body is empty.

@loonighan
Copy link

No problems with empty body tags. I use php mostly for populating,updating,creating in jTable
But I get duplicate entries if there is a function in the php.
Remove the function, no duplicate entries
Remarkable.

@hlev
Copy link

hlev commented Nov 3, 2016

@loonighan It's not empty HTML body tags, but HTTP responses with an empty response body, what are the problem. Such as responses to those AJAX requests you make with jTable.

@ccampbell
Copy link
Owner

Does anyone have an easy way for me to reproduce this? Thanks

@hlev
Copy link

hlev commented Apr 3, 2017

Sure. I actually managed to reproduce this with a non-empty response body as well.

// bug.php
<?php
include('ChromePhp.php');

$bug = 'duplication';
ChromePhp::log($bug);
echo 'boo';

With the PHP built-in webserver
php -S localhost:4545 bug.php

Enable the logger extension and visit localhost:4545 in Chrome.

Versions:
PHP 5.6.28 (cli) Linux
Chrome 56.0.2924.87 (64-bit)
Chrome Logger 4.1.1 extension
ChromePhp fresh from master

@hlev
Copy link

hlev commented Apr 3, 2017

Bugger. I think I found a bug in this approach itself an mislead myself.

Chrome makes two requests, one to localhost:4545 and one to localhost:4545/favicon.ico and both have the X-ChromeLogger-Data response header because the built-in webserver runs the script for each and every request by design. Silly me. That's the source of the duplication here.

It can be easily fixed though with a "route" and this time with really an empty response body.

<?php
include('ChromePhp.php');

if ($_SERVER['REQUEST_URI'] !== '/get')  {
 die();
}

$bug = 'duplication';
ChromePhp::log($bug);

Visit localhost:4545/get and the console will start duplicating the message.
Send any response and the duplication stops

<?php
include('ChromePhp.php');

if ($_SERVER['REQUEST_URI'] !== '/get')  {
 die();
}

$bug = 'duplication';
ChromePhp::log($bug);
echo 'no duplications here`

@bkdotcom
Copy link

If I go directly to "generateCss.php" ( sets Content-Type: text/css) I get duplicate log
if I'm on the html page that makes a request to "generateCss.php" .. the log is not duplicated.
¯\_(ツ)_/¯

@disccomp
Copy link

disccomp commented May 10, 2018

No missing favicon for me, console shows the output coming from two scripts:
debugger:///VM646 log.js (built-in script, click on it and source is blank)
chrome-extension://noaneddfkdjfnfdakjjmocngnfkfehhd/log.js (chromelogger)

(Chrome 66, OSX)

@danielserrao
Copy link

I got the same bug here. Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants