Last active
August 29, 2015 14:10
-
-
Save maranemil/f44564b52d3aa9c3fc66 to your computer and use it in GitHub Desktop.
Debug in SugarCRM
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// most entry points have this, except soap.php | |
// require_once ('log4php/LoggerManager.php'); # deprecated | |
require_once('include/SugarLogger/LoggerManager.php'); | |
$GLOBALS['log'] = LoggerManager::getLogger('SugarCRM'); | |
// depending on what your log level is set at in log4php.properties | |
$GLOBALS['log']->fatal(msg); | |
$GLOBALS['log']->debug(msg); | |
$GLOBALS['log']->info(msg); | |
$GLOBALS['log']->test('This is my test log message'); | |
$GLOBALS['log']->fatal("print some array: " . print_r($array, true)); | |
$GLOBALS['db']->query($sql); | |
Debug : Logs events that help in debugging the application. | |
Info : Logs informational messages and database queries. | |
Warn : Logs potentially harmful events. | |
Error : Logs error events in the application. | |
Fatal : Logs severe error events that leads the application to abort. This is the default level. | |
Security : Logs events that may compromise the security of the application. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment