mirror of
https://github.com/yuzu-emu/Command-fix.git
synced 2024-12-23 04:35:30 +00:00
Added logdna.
This commit is contained in:
parent
cffaa53879
commit
aa7b30680e
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
|
"logdnaKey": "",
|
||||||
"commandPrefix": ".",
|
"commandPrefix": ".",
|
||||||
"logChannel": null,
|
"logChannel": null,
|
||||||
"clientLoginToken": null,
|
"clientLoginToken": null,
|
||||||
|
|
26
logging.js
26
logging.js
|
@ -3,24 +3,28 @@ winston.emitErrs = true;
|
||||||
|
|
||||||
var logger = new winston.Logger({
|
var logger = new winston.Logger({
|
||||||
transports: [
|
transports: [
|
||||||
new winston.transports.File({
|
new winston.transports.Console({
|
||||||
level: 'info',
|
level: 'silly',
|
||||||
filename: './server.log',
|
|
||||||
handleExceptions: true,
|
handleExceptions: true,
|
||||||
humanReadableUnhandledException: true,
|
humanReadableUnhandledException: true,
|
||||||
json: true,
|
|
||||||
maxsize: 5242880, //5MB
|
|
||||||
maxFiles: 5,
|
|
||||||
colorize: false
|
|
||||||
}),
|
|
||||||
new winston.transports.Console({
|
|
||||||
level: 'debug',
|
|
||||||
handleExceptions: true,
|
|
||||||
json: false,
|
json: false,
|
||||||
colorize: true
|
colorize: true
|
||||||
})
|
})
|
||||||
],
|
],
|
||||||
|
handleExceptions: true,
|
||||||
exitOnError: false
|
exitOnError: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (process.env.NODE_ENV == 'production') {
|
||||||
|
// Setup logging for LogDNA cloud logging.
|
||||||
|
logger.add(winston.transports.Logdna, {
|
||||||
|
level: 'silly',
|
||||||
|
key: config.logdnaKey,
|
||||||
|
ip: ip.address(),
|
||||||
|
hostname: os.hostname(),
|
||||||
|
app: 'services-discordbot'
|
||||||
|
});
|
||||||
|
logger.info('[logging] Started LogDNA winston transport.');
|
||||||
|
}
|
||||||
|
|
||||||
module.exports = logger;
|
module.exports = logger;
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"config": "^1.24.0",
|
"config": "^1.24.0",
|
||||||
"discord.js": "^10.0.1",
|
"discord.js": "^10.0.1",
|
||||||
|
"logdna": "^1.2.3",
|
||||||
"request": "^2.79.0",
|
"request": "^2.79.0",
|
||||||
"winston": "^2.3.0"
|
"winston": "^2.3.0"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue