Adding Events for Login/Logout

May 30, 2012 at 9:38 PM

We're writing a module that will log events to a custom enterprise auditing system.

The rules module seems like the perfect framework for doing this, we just need to create custom events and custom actions. The first events we'd like to log are the user login and logout events.

Is using rules the best approach? If so, is there an example of how to do this somewhere?

FYI- We have a log4net appender currently, but want complete control over what gets logged (not just all info, for example), which is why Rules seems like the ideal solution.

May 30, 2012 at 11:13 PM

The rules module is interesting if you want to give the power user some level of customization, otherwise the EventBus is best suited for it. And you already have the user events for the event bus right now. It's just a matter of implementing IUserEventHandler and do what you want with it.

If you need to create actions and events then the best documentation is the current implementations. If you don't find them I can look into it quickly.

Jun 5, 2012 at 1:08 AM
Edited Jun 5, 2012 at 1:43 PM

IUserEventHandler looks perfect. And, after I remembered to enable my module, it worked like a charm.