-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Logging exceptions thown during AJAX requests if in development mode...? #425
Comments
Relates to https://forum.nette.org/cs/17844-tracy-reagujici-na-ajax-pozadavky#p146840
|
I have no idea where the error arises in this process. |
Switching Tracy into production mode should solve that. (Now I realized that the AJAX requests, that the initial issue is about, weren't sent with the X-Requested-With header, right?) |
Oh, looks like that's on me. It was quite late friday evening when I posted the last comment. The original post does really concern AJAX requests (with the But the solution I'm aiming for (having an option to be in development mode and at the same time have the ability to tell Tracy I want to log exceptions in HTML files) should be able to solve both of these problems.
... this is what I'm doing right now as a workaround, but it is a rather inconvenient way of development, where I have to turn the production mode off, and on, and off again, on again... - depending on whether I'm debugging an error shown inside browser or trying to make a HTTP request to my endpoint via |
Bumping this as I also just got f*cked by Tracy not logging Ajax requests. |
I am unable to reproduce this error, it works good for me. So please send me the minimal code (repository) where the error occurs. Or a patch. Otherwise, we're not moving forward, and I will close this issue as time goes on. |
Yeah, let's close it. |
I have noticed this behavior quite some time ago, but now I finally had time to investigate it a bit.
Example scenario
HTTP 500 error
and displays a nice error message, cool.log
folder and see it empty: "Oh... 🤔 The exception was not persisted to the log folder by the debugger."Why? After spending some time step-debugging, I discovered this piece of code in Tracy's
Debugger.php
:tracy/src/Tracy/Debugger/Debugger.php
Lines 321 to 324 in af8c8cd
(I am using
Tracy v2.6.8
, but here a very similar condition is seen in themaster
branch, so I guess the behavior is still the same...?)Is there any specific reason why these ajax exception are not stored as files, as would "ordinary" (non-ajax) exceptions be?
Because, the way I see it, logging AJAX-request-errors is maybe even more essential than ordinary non-ajax exceptions (which I can simply see in the browser). So I guess I'm just asking - is this on purpose...? 🤔
self::log($exception, self::EXCEPTION);
in there...)The text was updated successfully, but these errors were encountered: