UNPKG

openhim-core

Version:

The OpenHIM core application that provides logging and routing of http requests

44 lines (38 loc) 948 B
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.LogModel = exports.LogModelAPI = exports.LOG_LEVELS = undefined; var _mongoose = require('mongoose'); var _config = require('../config'); const LOG_LEVELS = exports.LOG_LEVELS = { debug: 1, info: 2, warn: 3, error: 4 }; const LogScheme = new _mongoose.Schema({ message: { type: String, required: true }, timestamp: { type: Date, default: Date.now, required: true }, level: { type: String, enum: Object.keys(LOG_LEVELS), required: true }, meta: { type: _mongoose.Schema.Types.Mixed, default: {} }, hostname: { type: String }, label: { type: String } }, { versionKey: false }); const LogModelAPI = exports.LogModelAPI = _config.connectionAPI.model('Log', LogScheme, 'log'); const LogModel = exports.LogModel = _config.connectionDefault.model('Log', LogScheme, 'log'); //# sourceMappingURL=log.js.map