Page MenuHomeIn-Portal Phabricator

INP-1910 - Allow specifying upcoming System Log record defaults
Needs ReviewPublic

Authored by alex on Sat, May 24, 9:17 AM.

Details

Reviewers
erik
Test Plan

Preparations

  1. apply changes from the D466 (code & database changes) if they're not present yet
  2. in IDE:
    • open the /system/config.php file for editing
    • ensure that these lines are present:
$_CONFIG['Misc']['SystemLogIncludeRequestData'] = '0';
$_CONFIG['Misc']['SystemLogRequestDataLimit'] = '5KB';
  • save changes

Part 1 - no defaults (notice)

  1. in IDE:
    • open /units/users/users_event_handler.php file for editing
    • replace any code above the parent::SetCustomQuery($event); line in the \UsersEventHandler::SetCustomQuery method with this one:
trigger_error('test notice 1');
trigger_error('test notice 2');
    • save changes
  1. in Admin Console:
    • go to the User ManagementAdministrators section
    • confirm that you're seeing the records in the Debugger report about the above-triggered notices
    • go to the Logs & ReportsSystem Log section
    • confirm, that:
      • you're seeing the records in the System Log grid about the above-triggered notices
      • these records don't have Request Data and Session Data fields present on their detail page

Part 2 - no defaults (exception)

  1. in IDE:
    • open /units/users/users_event_handler.php file for editing
    • replace any code above the parent::SetCustomQuery($event); line in the \UsersEventHandler::SetCustomQuery method with this one:
throw new Exception('test exception');
    • save changes
  1. in Admin Console:
    • go to the User ManagementAdministrators section
    • confirm that you're seeing a record in the Debugger report about the above-thrown exception
    • go to the Logs & ReportsSystem Log section
    • confirm that,
      • you're seeing a record in the System Log grid about the above-thrown exception
      • that record doesn't have Request Data and Session Data fields present on its detail page

Part 3 - defaults (notice)

NOTE: Ignore the System Log notification E-mail not specified notice.
  1. in IDE:
    • open /units/users/users_event_handler.php file for editing
    • replace any code above the parent::SetCustomQuery($event); line in the \UsersEventHandler::SetCustomQuery method with this one:
$this->Application->log('')->notify(true)->addRequestData()->addSessionData();
trigger_error('test notice 1');

trigger_error('test notice 2');
    • save changes
  1. in Admin Console:
    • go to the User ManagementAdministrators section
    • confirm that you're seeing the records in the Debugger report about the above-triggered notices
    • go to the Logs & ReportsSystem Log section
    • confirm, that:
      • you're seeing the records in the System Log grid about the above-triggered notices
      • 1st above-found record has Sent value in the Notification Status field and Request Data and Session Data fields present on its detail page
      • 2nd above-found record has Disabled value in the Notification Status field and Request Data and Session Data fields absent on its detail page

Part 4 - defaults (exception)

NOTE: Ignore the System Log notification E-mail not specified notice.
  1. in IDE:
    • open /units/users/users_event_handler.php file for editing
    • replace any code above the parent::SetCustomQuery($event); line in the \UsersEventHandler::SetCustomQuery method with this one:
$this->Application->log('')->notify(true)->addRequestData()->addSessionData();

throw new Exception('test exception');
    • save changes
  1. in Admin Console:
    • go to the User ManagementAdministrators section
    • confirm that you're seeing a record in the Debugger report about the above-thrown exception
    • go to the Logs & ReportsSystem Log section
    • confirm, that:
      • you're seeing a record in the System Log grid about the above-thrown exception
      • Request Data and Session Data fields present on its detail page

Diff Detail

Repository
rINP In-Portal
Branch
/in-portal/branches/5.2.x
Lint
Lint ErrorsExcuse: Unrelated to the made changes.
SeverityLocationCodeMessage
Errorcore/kernel/utility/logger.php:338PHPCS.E.CodingStandard.Arrays.Array.SpaceAfterKeywordCodingStandard.Arrays.Array.SpaceAfterKeyword
Errorcore/kernel/utility/logger.php:338PHPCS.E.Generic.PHP.LowerCaseKeyword.FoundGeneric.PHP.LowerCaseKeyword.Found
Unit
No Unit Test Coverage
Build Status
Buildable 11085
Build 3785: arc lint + arc unit

Event Timeline

alex created this revision.Sat, May 24, 9:17 AM
alex requested review of this revision.Sat, May 24, 9:17 AM
alex updated this revision to Diff 1340.Sat, May 24, 9:31 AM

Added code to support changes from the D466.

alex edited the test plan for this revision. (Show Details)Sat, May 24, 9:45 AM