File tree 4 files changed +18
-3
lines changed 4 files changed +18
-3
lines changed Original file line number Diff line number Diff line change 49
49
"rxjs" : " 5.0.0-beta.6" ,
50
50
"simplemde" : " ^1.11.2" ,
51
51
"winston" : " ^2.2.0" ,
52
- "zone.js" : " ^0.6.12"
52
+ "zone.js" : " ^0.6.12" ,
53
+ "winston-mongodb" : " ~1.6.0"
53
54
},
54
55
"devDependencies" : {
55
56
"bson" : " ^0.5.0" ,
Original file line number Diff line number Diff line change 4
4
"etcd_node_ip" : " 192.168.56.102" ,
5
5
"etcd_node_port" : " 2379" ,
6
6
"etcd_user" : " cem" ,
7
- "etcd_pass" : " ersoz"
7
+ "etcd_pass" : " ersoz" ,
8
+ "default_image" : " alpine" ,
9
+ "mongo_log_url" : " ds025792.mlab.com:25792/tuxlab" ,
10
+ "mongo_log_collection" : " logs"
8
11
}
Original file line number Diff line number Diff line change 2
2
Winston Logger for TuxLab-app
3
3
*/
4
4
var winston = require ( 'winston' ) ;
5
+ var nconf = require ( 'nconf' ) ;
6
+
7
+ require ( 'winston-mongodb' ) . MongoDB ;
8
+
9
+ var log_collection_name = nconf . get ( 'mongo_log_collection' ) ;
10
+
11
+ logs_collection = new Mongo . Collection ( log_collection_name ) ;
12
+
5
13
TuxLog = new ( winston . Logger ) ( {
6
14
transports : [
7
15
new ( winston . transports . Console ) ( ) ,
8
- new ( winston . transports . File ) ( { filename : 'tuxlab.log' } ) //Replace with GrayLog
16
+ new ( winston . transports . MongoDB ) ( { db : logs_collection . rawDatabase ( ) , collection : log_collection_name } )
9
17
]
10
18
} ) ;
Original file line number Diff line number Diff line change @@ -26,6 +26,9 @@ Collections.labs = labs;
26
26
import { course_records } from "../collections/course_records.ts" ;
27
27
Collections . course_records = course_records ;
28
28
29
+ Collections . logs = logs_collection ;
30
+
31
+ //import meteor methods
29
32
// LabFile Cache
30
33
var NodeCache = require ( 'node-cache' ) ;
31
34
LabCache = new NodeCache ( {
You can’t perform that action at this time.
0 commit comments