mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-11-22 09:25:37 +01:00
33 lines
774 B
JavaScript
33 lines
774 B
JavaScript
const winston = require('winston');
|
|
const ip = require('ip');
|
|
const os = require("os");
|
|
const logdna = require('logdna');
|
|
|
|
winston.emitErrs = true;
|
|
|
|
var logger = new winston.Logger({
|
|
level: 'debug',
|
|
transports: [
|
|
new (winston.transports.Console)(),
|
|
],
|
|
handleExceptions: true,
|
|
humanReadableUnhandledException: true,
|
|
exitOnError: false,
|
|
meta: true
|
|
});
|
|
|
|
// Setup logging for LogDNA cloud logging.
|
|
if (process.env.LOGDNA_API_KEY) {
|
|
logger.add(winston.transports.Logdna, {
|
|
level: 'info',
|
|
app: 'discord-bot',
|
|
index_meta: true,
|
|
key: process.env.LOGDNA_API_KEY,
|
|
ip: ip.address(),
|
|
hostname: os.hostname()
|
|
});
|
|
logger.info('Started LogDNA winston transport.');
|
|
}
|
|
|
|
module.exports = logger;
|