Problem/Motivation

Currently, admin_audit_trail does not log any message if Drupal is running in CLI (eg. via Drush). There are certain systems mandating logging all activities regardless of which environment Drupal is running on.

Proposed resolution

Introduce a new global setting to control whether admin_audit_trail should work in CLI.

User interface changes

  • A new checkbox is added to Site settings form
  • A new settings form is added under admin Configuration > System

settings

API changes

  • N/A

Data model changes

  • N/A
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

sonnykt created an issue. See original summary.

sonnykt’s picture

Status: Active » Needs review
StatusFileSize
new2.42 KB
sonnykt’s picture

StatusFileSize
new2.43 KB

Correct patch file with the default setting to disable CLI.

rajab natshah’s picture

Assigned: Unassigned » mohammed j. razem

Thanks, Sonny, for suggesting, reporting, and the patch

I like the idea.

Suggesting to have an Admin audit trails settings page with permission of access admin audit trails settings

admin_audit_trail.settings:
  path: "/admin/reports/audit-trail/settings"
  defaults:
    _form: '\Drupal\admin_audit_trail\Form\GeneralSettingsForm'
    _title: "Admin audit trails settings"
  requirements:
    _permission: "access admin audit trails settings"

This General settings form and page can have more settings, and it can extend ConfigFormBase for better practice and to work with schema configs too.

rajab natshah’s picture

Assigned: mohammed j. razem » Unassigned

sonnykt’s picture

Issue summary: View changes
StatusFileSize
new888.26 KB
yovince’s picture

Just rerolled the patch to make it compatible with 1.0.7.

nadim hossain made their first commit to this issue’s fork.

nadim hossain’s picture

StatusFileSize
new3.26 KB

I’ve updated the patch to align the hook numbers. I’ve also updated the merge request and resolved the conflict with the base branch.

This has been around for a while now and has already been tested and used. It would be great to get a review so we can move it to RTBC and get it merged.

Thanks!

rajab natshah’s picture

Status: Needs review » Postponed
rajab natshah’s picture

Status: Postponed » Needs work

Add a flag to the logs to show that it was from a CLI .

rajab natshah’s picture

Status: Needs work » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

rajab natshah’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.