Skip to content

Improved logging, richer stack traces - 7.14 #10342

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

Open
wants to merge 1 commit into
base: hotfix
Choose a base branch
from

Conversation

pgorod
Copy link
Contributor

@pgorod pgorod commented Jan 26, 2024

NOTE: this is the redone version of a much older PR, #8640 which has a bunch of comments and code reviews, in case any one wants to check for historical reasons

Description, Motivation and Context

Adds some config_override.php options to get more information in the logs, specifically:

  • ability to ask for richer information regarding a single error message, making it easier to focus on a specific problem
  • ability to get more highly technical information without being a technical user (useful for Forums troubleshooting and gathering info from clients)
  • get IDE-level stack traces, with both argument names and values

Documentation preview

https://pedro--suitedocs.netlify.app/developer/logging/#_advanced_logging_configuration

How To Test This

Please read the documentation linked above, there are many options.

An important part of the testing is confirming that nothing changes until we start putting options in config_override.php. This will make me more confident about putting the code out there :-)

For a simple run, you can test this by adding entries in your config_override.php such as these (all explained in the Docs page):

$sugar_config['show_log_trace'] = 'One2MBeanRelationship'; // use a boolean true for all; or a string as filter
$sugar_config['show_log_trace_with_eol'] = true;
$sugar_config['show_log_trace_overview'] = true;
$sugar_config['show_log_trace_trim'] = 500;
$sugar_config['show_log_trace_source'] = 1;

Answers to some valid concerns

  1. This is backwards compatible because it does not assume any config values to be there, always uses sensible defaults, and respects the previous meaning of $sugar_config['show_log_trace'].

  2. This code is complex, and some bug can have slipped by, but it only runs in the cases where you select log traces, so it's easy to turn off, and shouldn't affect production systems.

  3. Some of this code impacts performance (lots of string operations, more file activity) but it's always opt-in: the impact only occurs when you configure it to happen.

  4. This is accompanied with a warning in Documentation: using log traces with argument values might leave sensitive information in the system logs. Use it only temporarily for troubleshooting purposes; obfuscate the information before posting it online; double-check that your logs are only accessible to admins; delete the logs when finished troubleshooting.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Final checklist

  • My code follows the code style of this project found here.
  • My change requires a change to the documentation.
  • I have read the How to Contribute guidelines.

@SuiteBot
Copy link

This pull request has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/suite-crm-8-5-1-massive-log-spam-of-the-below-4-lines/91876/9

@SuiteBot
Copy link

This pull request has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/how-to-remove-the-depreciated-mpdf-module/92166/6

@SuiteBot
Copy link

This pull request has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/error-in-suitecrm8-editviewdefs-php-is-missing/92154/22

@SuiteBot
Copy link

This pull request has been mentioned on SuiteCRM. There might be relevant details there:

https://community.suitecrm.com/t/there-is-no-action-in-quotes/93115/13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants