Skip to content

Clear log messages button

Suraj Kothawade edited this page Jun 22, 2017 · 3 revisions

Motivation

The event log module should have the ability to wipe all existing event logs. Possibly behind a permission so that only privileged users are able to clear them. Typically all logs are verified which is why the module should have the ability to just get rid of the ones that are verified to remove clutter.

This is also great during releases to start from a fresh log.

Upstream issue link : https://www.drupal.org/node/2275743

Description

This feature enables the administrator and privileged users to clear event logs just on the click of button. This button is located in the configuration option in the modules section corresponding to the Delete Log module.

Implementation

A new sub-module named event_log_delete is added in the event_log folder. The .module file implements the desired action using a couple of hook api functions namely, hook_menu and hook_permission.

Details about this functions can be found at :

Issues

  1. Added Sub-Module does not appear in the same section as the event log

  2. No configuration option corresponding to the added sub-module

Solutions to issues

  1. Add a package name and dependencies to your .info file so that your sub-module appears under the right section, which is statistics in the event_log module case.

E.g : package = Statistics

dependencies[] = event_log

  1. Add configure = admin/config/event_log_delete

Link to git issue

https://github.com/fresearchgroup/drupal-logger/issues/6