Added support for event logging

It is now possible to log important events to the database (such as
failed logins and other audit information).