Skip to content
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

Merged
merged 12 commits into from
May 1, 2017
Merged

System Logs v2 #2424

merged 12 commits into from
May 1, 2017

Conversation

DawoudIO
Copy link
Contributor

@DawoudIO DawoudIO commented Apr 29, 2017

overtakes #2278

- if debug is on - then use file logger to a local file
- if debug is off - then use a null handler
@DawoudIO DawoudIO added this to the 2.7.4 milestone Apr 29, 2017
@ghost ghost assigned DawoudIO Apr 29, 2017
@ghost ghost added In Review and removed bug labels Apr 29, 2017
@DawoudIO DawoudIO changed the title System Logs System Logs v2 Apr 29, 2017
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Contributor

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()

Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

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";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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).

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DawoudIO
Copy link
Contributor Author

please approve as this is a P0 in prod systems

@crossan007 crossan007 merged commit f2216bf into master May 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

disable debug setting by default 403 Forbidden error when saving System Settings
2 participants