WordPress.org

Ready to get started?Download WordPress

Forums

Perfect system log plugin (2 posts)

  1. pete2
    Member
    Posted 8 years ago #

    Anyone heard of any kind of proper system logging plugin for wordpress? I have searched but not found any -- there are lots of all kinds of statistics plugins around that can be done on a webserver-level too, but no plugins that I know of that would utilize wordpress's action hook system to actually log user activities within a system and display them to the administrators at least. Many collaborative blogs would benefit one, not least as a poor version control system to see who has changed what during last days, and the demand may increase due to new roles and capabilities fuctionalities. I guess it would be fairly easy to write for somebody who has up-to-date action hook knowledge.

    Two relevant links could be http://wordpress.org/support/topic/940 (two years old!) and http://drupal.org/node/3944, http://drupal.org/node/300 and perhaps http://drupal.org/node/11564 even though that is pretty basic and done by many statistics plugins already.

  2. pete2
    Member
    Posted 8 years ago #

    Hola, as I didn't find any, I developed a system event logging plugin. It's a terrible hack as I'm not a coder, so pls proceed with care. After activation it
    - lists an system event log menu under dashboard (writes log data to wp-content/systemlog.txt) with timestamps, acting users and item edit links
    - sends email to admin when anyone saves a draft of a post (speeds publishing of posts in moderated blogs)

    Following texts give a hint of what actions are logged:
    'Created new category no. xx'
    'Deleted category no. xx'
    'Created new comment no. xx'
    'Received pingback comment no. xx'
    'Received trackback comment no. xx'
    'Edited comment no. xx'
    'Changed comment no. xx, status: xxx'
    'Deleted comment no. xx'
    'Tried to comment on closed post no. xx'
    'Tried to comment on nonexisting post no. xx'
    'Tried to comment on draft no. xx'
    'Comment flooding triggered, interval xx s'
    'Created new post/page no. xx'
    'Changed from private to published post no. xx'
    'Published post no. xx'
    'Published from phone: post no. xx'
    'Edited post/page no. xx'
    'Deleted post/page no. xx'
    'Profile change for user xxxx'
    'User lost password'
    'Change password query mailed to user xxxx'
    'Password reset for user xxxx'
    'New user registered: no. xx'
    'Logged in: xxxx'
    'Logged out.'
    'Changed template theme to xxxxx'

    As you can see I implemented pretty much all action hooks that may be worth logging and are available to plugins?

    The code is downloadable from
    >> http://pastebin.com/470738
    (tested only on wp 1.5.2 on *nix)

    Paste it to new some.php file in plugins/ (remember not to leave any enter after closing tag in the file), and activate. It may work on most *nix environments (uses tail and tac in quite a horrible way to display the log under dashboard as I didn't put it in the database). On a busy blog just comment away the actions you don't want to log, such as comment_post that would otherwise fill your log.

    Even though this particular implementation is a terrible hack (I don't know if it even had some security problems), I very much like this kind of system event logging functionality on a multi-user blog and would definitely like to see a proper implementation in the wordpress core - this is such an improvement to be able to see what really is happening in your blog admin.

    As I'm not going to mantain this plugin, this forum thread will be the only place in the net to announce it now -- maybe someone will find it someday and find it nice, or get a spark to develop a proper system event logger. I just wanted to share this with you.

Topic Closed

This topic has been closed to new replies.

About this Topic