Major changes around events, event log, etc.

* User event log is now functional & attached to various events
* Add additional missing system events
* Completely re-write last_callers to have new functionality, etc.
* Events.addListenerMultipleEvents()
* New 'moduleInitialize' export for module init vs Event specific registerEvents
* Add docs on last_callers mod
This commit is contained in:
Bryan Ashby 2018-07-21 14:32:06 -06:00
parent c1ae3d88ba
commit 52585c78f0
16 changed files with 392 additions and 171 deletions

View file

@ -87,7 +87,11 @@ function userLogin(client, username, password, cb) {
},
function recordLoginHistory(callback) {
const LOGIN_HISTORY_MAX = 200; // history of up to last 200 callers
return StatLog.appendSystemLogEntry('user_login_history', user.userId, LOGIN_HISTORY_MAX, StatLog.KeepType.Max, callback);
const historyItem = JSON.stringify({
userId : user.userId,
sessionId : user.sessionId,
});
return StatLog.appendSystemLogEntry('user_login_history', historyItem, LOGIN_HISTORY_MAX, StatLog.KeepType.Max, callback);
}
],
err => {