mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 08:05:53 +03:00
[GH-ISSUE #56] ChromePHP Handler #15
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#15
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @bdvir on GitHub (Feb 19, 2012).
Original GitHub issue: https://github.com/Seldaek/monolog/issues/56
Feature request.
Do you have any plans implementing http://www.chromephp.com/ handler?
@stof commented on GitHub (Feb 19, 2012):
This look interesting.
@ccampbell do you have a place where you describe the way the headers should be formatted to send a log message to the extension ?
@ccampbell commented on GitHub (Feb 19, 2012):
I don't have it documented anywhere, but I can give a brief overview.
The data to be logged starts out with an array that looks like this:
Each log is an array entry in rows that looks like this:
Then you would convert this data to a header by doing something like this:
Check out the source at: https://github.com/ccampbell/chromephp/blob/master/ChromePhp.php to see exactly what is going on.
@stof commented on GitHub (Feb 19, 2012):
OK, so we need to create a big array and set it as a single header.
do you have an idea about how we could handle the context array provided with Monolog messages ? for all messages, we are able to pass a string message and an array of context (for instance, we can use it to log the SQL query and the array of bound parameters). For FirePHP, we currently send
array('message' => $message, 'context' => $context)as logged data but maybe something better can be done for ChromePHP ?@stof commented on GitHub (Feb 19, 2012):
@ccampbell btw, does the extension change the user agent or add a custom request header that we could use to send the ChromePHP header only for browsers that have ChromePHP (thus avoiding issues with IE that has a lower limit for the header size) ?
@ccampbell commented on GitHub (Feb 20, 2012):
Right now I do not add any additional headers client side, but I will add it if it will be useful to you. You could also do a UA check to make sure it is Chrome before setting the header maybe?
@stof commented on GitHub (Feb 20, 2012):
well, we could detect Chrome, but it would even be better if we know that it is Chrome with ChromePHP.
Btw, I saw a weird thing when testing it. For the error level message, a stack trace inside the extension was added to the console message, whereas other levels were clean. Is it a bug in the extension ? You can reproduce it by accessing
monolog/tests/Monolog/Functional/Handler/FirePHPHandlerTest.phpwhen using the code in my PR linked above.@ccampbell commented on GitHub (Feb 20, 2012):
I noticed this too, I believe this is something that Chrome added to the console in Chrome 17. If you do any console.error() regardless of if it is a javascript error it shows a js stack trace.
You can reproduce by simply opening up the console:

So I'm not sure if there is any way around it, but I will see.
@Seldaek commented on GitHub (Feb 20, 2012):
@stof the problem in IE was only caused by having too many headers I think, not very large ones like in this case, but that said there might be a limit there that I didn't hit. Anyway having a custom header of some sort when ChromePHP is enabled would be quite nice.
@stof commented on GitHub (Feb 20, 2012):
@Seldaek I updated the PR to detect Chrome at least.
@AndreBaumeier commented on GitHub (Jun 12, 2014):
Is there a documentation entry for what exact chrome extension the ChromePHPHandler was built? I am lucky to found this issue, because there are multiple extensions claiming to be (a) chrome php logger.
@stof commented on GitHub (Jun 12, 2014):
The readme has a link to the extension website