Skip to content

Commit

Permalink
you're a docker container why tf are you logging to disk
Browse files Browse the repository at this point in the history
  • Loading branch information
ILiedAboutCake committed Apr 1, 2023
1 parent a4a5f13 commit 8372346
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/configuration/sample.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"scheduledCommands":["!youtube", "!schedule"],
"logger": {
"logToFile": false
"level": "debug"
},
"overRustle": {
"url": "https://overrustlelogs.net"
Expand Down
20 changes: 7 additions & 13 deletions lib/services/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@ const bunyan = require('bunyan');
function configureLogger(config) {
const bunyanConf = { name: 'dggChatBot' };

if (config.logToFile) {
bunyanConf.streams = [
{
level: 'info',
stream: process.stdout, // log INFO and above to stdout
},
{
level: config.level,
path: `${__dirname}../logs/errors.logs`, // log ERROR and above to a file
},
];
}

bunyanConf.streams = [
{
level: config.level,
stream: process.stdout, // log INFO and above to stdout
}
];

return bunyan.createLogger(bunyanConf);
}

Expand Down

0 comments on commit 8372346

Please sign in to comment.