Skip to content

Commit ae8d42d

Browse files
committed
2 parents 6ca0066 + 9697c8e commit ae8d42d

File tree

4 files changed

+18
-3
lines changed

4 files changed

+18
-3
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@
4949
"rxjs": "5.0.0-beta.6",
5050
"simplemde": "^1.11.2",
5151
"winston": "^2.2.0",
52-
"zone.js": "^0.6.12"
52+
"zone.js": "^0.6.12",
53+
"winston-mongodb": "~1.6.0"
5354
},
5455
"devDependencies": {
5556
"bson": "^0.5.0",

private/settings.env.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,8 @@
44
"etcd_node_ip": "192.168.56.102",
55
"etcd_node_port": "2379",
66
"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"
811
}

server/imports/startup/log.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
Winston Logger for TuxLab-app
33
*/
44
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+
513
TuxLog = new (winston.Logger)({
614
transports: [
715
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})
917
]
1018
});

server/main.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Collections.labs = labs;
2626
import {course_records} from "../collections/course_records.ts";
2727
Collections.course_records = course_records;
2828

29+
Collections.logs = logs_collection;
30+
31+
//import meteor methods
2932
// LabFile Cache
3033
var NodeCache = require('node-cache');
3134
LabCache = new NodeCache({

0 commit comments

Comments
 (0)