Depending on what your Log Level is set to in the system settings you can log errors to the sugarcrm.log located in the root folder with the following code snippets
$GLOBALS['log']->fatal("My fatal message");
$GLOBALS['log']->debug("My debug message");
$GLOBALS['log']->info("My log message");
Hope you find this blog post helpful.
Feel free to add comments and queries, that helps us to improve the quality of posts.
You can contact us at [email protected]
Thank you.