You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a lot of code called in beginTrace for no reason, when debugging is turned off. That's assuming I'm not missing anything,
But even with debugging turned off, debug_backtrace and other functions are called regardless, if debugging/logging is on or off. Would it make sense for this to be a simple bool check wrapped around the begin and end trace.
Is this really needed in production, I've found it useful, especially with pgt issues, but I wonder if there are other methods that would prove more useful?
The text was updated successfully, but these errors were encountered:
conwaydalej
changed the title
beginTrace/endTrace
beginTrace/endTrace optimization
Apr 7, 2020
Well even in production there are people who wants to log all auth-related actions, but I agree that for unknown reason, this is quite messed with too detailed debugging information for the log.
Probably putting a switch at the beginning of those trace-related functions (traceBegin / traceEnd) might help.
This is related to #57. The current "logging" was done simply for full debugging at a very early stage. Nobody ever looked at performance or practical issues like normal operational logging requirements.
We should really consider rewriting this to have a proper logging setup with log levels etc.
Looking at your specific proposal I'm not sure how much performance is improved when using variables.... To really speed up we should use leverage constants so that the optimizer can really remove code instead of going through many switches/ifs. Not sure about the best way in php though....
+1 for log levels. Unless I am missing something? I am not seeing an option to enable logging for errors only. It does not make sense to have a detailed log for every normal request on production, but we need errors logged regardless of debug mode being on/off. Also having the option to log to the default PHP log destination, with the stack trace all as a single message would be great!
There seems to be a lot of code called in beginTrace for no reason, when debugging is turned off. That's assuming I'm not missing anything,
But even with debugging turned off, debug_backtrace and other functions are called regardless, if debugging/logging is on or off. Would it make sense for this to be a simple bool check wrapped around the begin and end trace.
Is this really needed in production, I've found it useful, especially with pgt issues, but I wonder if there are other methods that would prove more useful?
The text was updated successfully, but these errors were encountered: