Integrate winston-papertrail plugin
This commit is contained in:
36
src/dao/papertrail.js
Normal file
36
src/dao/papertrail.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Mailvelope - secure email with OpenPGP encryption for Webmail
|
||||
* Copyright (C) 2016 Mailvelope GmbH
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License version 3
|
||||
* as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
const log = require('winston');
|
||||
const config = require('config');
|
||||
require('winston-papertrail');
|
||||
|
||||
log.exitOnError = false;
|
||||
log.level = config.log.level;
|
||||
|
||||
exports.init = function({host, port}) {
|
||||
if (!host || !port) {
|
||||
return;
|
||||
}
|
||||
log.add(log.transports.Papertrail, {
|
||||
level: config.log.level,
|
||||
host,
|
||||
port
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user