Zebra_Database
Zebra_Database copied to clipboard
Logging is not working When using Zebra_Session
I can't get Zebra_Database log queries to log file when using Zebra_Session. I am using last version on both classes. Logging is working great with out using the Session class Any clues what cases this ?
What exactly is not working? What is the error message?
Sorry, It was a bug in my code. Great job by the way (Y)
Hey, maybe you can tell me what you'd want different in the file logging? I used this opportunity to have a look at the output - i don't use this feature usually - and I noticed it didn't look that good and that it could use some improvements I was thinking about formatting the SQL query rather than being in a single line. Do you have any other requests?
I always use this feature. Very handy when I write a lot of mobile apps backend. I could monitor & debug MySQL quires without interrupt the final JSON output . Here's some improvement related to my issue. The 1st one is the logging is completely disabled when I use the class in an Ajax request, fixed by commit line 827. https://github.com/stefangabos/Zebra_Database/blob/df8d6dd2a8d86d298f8a970f49b7b9a0180bbd7d/Zebra_Database.php#L827 And set $db->debug = array(false,false,false), The logs goes to the log file & no debugging information printed on the screen..
2nd one, when setting $db->debug = true, The get debugging information printed on screen but without log to logfile. It will be nice to enable both. I preferred log to file rather than on screen.
Also, formatting the query will be great
Thank you for such a great classes 👍
- right, when AJAX i should disable only printing on screen - as that would mess up everything, but still log to file if set so - ok
- i have no idea how to do both without sacrificing backward compatibility. maybe a new way of setting the value of
$debug
- suggestions are welcome
What about adding a new config parameter, for printing on screen, Ex. $db->printOnScreen = true/false - maybe set to false by default. And leave the other $debug var for file logging only ! I think this is the best way for backward compatibility