-
Notifications
You must be signed in to change notification settings - Fork 443
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
System Logs v2 #2424
System Logs v2 #2424
Conversation
- if debug is on - then use file logger to a local file - if debug is off - then use a null handler
@@ -289,7 +289,7 @@ function RunQuery($sSQL, $bStopOnError = true) | |||
if ($result = mysqli_query($cnInfoCentral, $sSQL)) { | |||
return $result; | |||
} elseif ($bStopOnError) { | |||
if (SystemConfig::getValue('debug')) { | |||
if (SystemConfig::getValue('sLogLevel ') == "100") { // debug level |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe make this write to the log instead of die()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, if DEBUG is set, all queries should be logged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm that is now outside MVP... the goal of this PR is to ensure we don't crash... please open a issue to track it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// ORM Logs | ||
$ormLogger = new Logger('ormLogger'); | ||
$dbClassName = "\\Propel\\Runtime\\Connection\\DebugPDO"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need a conditional here:
https://github.com/ChurchCRM/CRM/pull/2278/files#diff-e9848400293ecb36fea0aef7708d40f5R138
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
http://propelorm.org/documentation/07-logging.html
You can also disable the debug mode at runtime, by calling PropelPDO::useDebug(false). Using this method, you can choose to enable the debug mode for only one particular query, or for all queries.
Alternatively, you can ask Propel to always enable the debug mode for a particular connection by using the Propel\Runtime\Connection\DebugPDO class instead of the default ConnectionWrapper class. This is accomplished in the configuration file, in the classname node of a given datasource connection (see the configuration reference for more details).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
again please open an issue to track, the goal was not to crash the system
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please approve as this is a P0 in prod systems |
overtakes #2278