Commit 0c38e108 authored by Félix Hamel's avatar Félix Hamel

+ Add support for Timber

parent 98adcb0b
......@@ -22,7 +22,9 @@ var P = require("bluebird"),
bformat = require("bunyan-format"),
Injector = require("./injector"),
_ = require("lodash"),
os = require('os');
os = require('os'),
timber = require('timber'),
LogDNAStream = require("logdna-bunyan").BunyanStream;
// Prepare logs
/// If we don't have the LogDNA key, we don't use it
......@@ -33,9 +35,22 @@ var streams = [
}
];
// Prepare LogDNA configuration
// Add support for Timber
if(typeof process.env.TIMBER_KEY !== "undefined") {
console.debug("Setting Timber logger transport...");
var transport = new timber.transports.HTTPS(process.env.TIMBER_KEY);
timber.install(transport);
streams.push({
name: process.env.TIMBER_NAME || 'core',
level: process.env.TIMBER_LEVEL || "info",
stream: new timber.transports.Bunyan()
});
}
// Add support for LogDNA
if (typeof process.env.LOGDNA_KEY !== "undefined") {
var LogDNAStream = require("logdna-bunyan").BunyanStream;
console.debug("Setting LogDNA logger transport...");
var logDNA = new LogDNAStream({
key: process.env.LOGDNA_KEY,
app: process.env.LOGDNA_APP_NAME || "core",
......
{
"name": "cmbf-core",
"version": "1.7.21",
"version": "1.7.22",
"description": "Covistra Mobile-Backend Framework Core Module",
"main": "index.js",
"scripts": {
......@@ -10,7 +10,7 @@
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/Covistra/covistra-core"
"url": "https://gitlab.cellars.io/celliers-public/covistra-core.git"
},
"dependencies": {
"bluebird": "2.10.0",
......@@ -33,6 +33,7 @@
"joi": "8.0.5",
"lodash": "4.17.10",
"logdna-bunyan": "^1.0.1",
"timber": "^3.1.3",
"vision": "2.0.1"
},
"devDependencies": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment