chromelogger icon indicating copy to clipboard operation
chromelogger copied to clipboard

Chrome 50 displaying duplicate log entries

Open richardwo opened this issue 9 years ago • 10 comments

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.

richardwo avatar Apr 27 '16 11:04 richardwo

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.

hlev avatar Jul 12 '16 08:07 hlev

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

AndreKR avatar Aug 27 '16 12:08 AndreKR

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.

loonighan avatar Nov 03 '16 10:11 loonighan

@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.

hlev avatar Nov 03 '16 12:11 hlev

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

ccampbell avatar Apr 03 '17 01:04 ccampbell

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 avatar Apr 03 '17 12:04 hlev

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`

hlev avatar Apr 03 '17 12:04 hlev

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. ¯\_(ツ)_/¯

bkdotcom avatar Aug 26 '17 02:08 bkdotcom

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)

disccomp avatar May 10 '18 03:05 disccomp

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

danielserrao avatar Jun 03 '18 08:06 danielserrao