Page MenuHomeIn-Portal Phabricator

INP-1910 - Allow specifying upcoming System Log record defaults
ClosedPublic

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

Details

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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

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

Added code to support changes from the D466.

alex edited the test plan for this revision. (Show Details)May 24 2025, 9:45 AM
erik accepted this revision.May 26 2025, 8:59 AM
This revision is now accepted and ready to land.May 26 2025, 8:59 AM
This revision was landed with ongoing or failed builds.Sun, Aug 31, 11:43 AM
This revision was automatically updated to reflect the committed changes.