Jump to content

prevent system logs for user role

Recommended Posts

Put this in your ready.php (I'm not sure if this hook affects errors and exceptions too)

wire()->addHookBefore('WireLog::save', function($e) {
    if ($this->wire('user')->hasRole('superuser')) {
        $e->replace = true;
        $e->return = false;


  • Like 4

Share this post

Link to post
Share on other sites

Great, kixe,

I did put it into a module. Works fine.

I have noticed, that loginerrors, eg caused by wrong pwd, are still logged, but with the user guest.

Can anyone give clearance about what this hook will cover and what not?

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...