For a production site, for auditing purposes, I would like to disable the "clear log messages" functionality for all administrators. This function is shown within admin/reports/dblog (within the "Recent log messages" report).

How to do this?

2 Answers 2


You would have to use hook_form_alter, and either remove that form or put access control on it. This needs to happen in a custom module.


A quick css display:none on the form will do it, assuming you trust your administrators enough to not go into "inspect element" and turn it back on again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.