-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
49 lines (41 loc) · 1.17 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var winston = require('winston');
winston.loggers.add('http_access',{
file: {
filename: process.cwd()+'/logs/http_access.log'
}
});
winston.loggers.add('newUsers',{
file: {
filename: process.cwd()+'/logs/newUsers.log'
}
});
winston.loggers.add('notifies',{
file: {
filename: process.cwd()+'/logs/notifies.log'
}
});
winston.loggers.add('errors',{
file: {
filename: process.cwd()+'/logs/errors.log'
}
});
var httpLog = winston.loggers.get('http_access'),
newUserLog = winston.loggers.get('newUsers'),
notifyLog = winston.loggers.get('notifies'),
errorLog = winston.loggers.get('errors');
exports.name = 'kabamPluginLoggerFile';
exports.listeners = {
'http' : httpLog.info,
'error': errorLog.error, //logging errors
//logging new users
'users:signUp': newUserLog.info,
'users:signUpByEmailOnly': newUserLog.info,
'users:completeProfile': newUserLog.info,
'users:findOneByApiKeyAndVerify': newUserLog.info,
//logging roles managment - todo - create proper security logging for it
'users:revokeRole': function(){},
'users:grantRole': function(){},
//notifications
'notify:email': notifyLog.info,
'notify:sio': notifyLog.info
};