-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: remove debug params ,only set by server side
feature:update logger to gen a log file for any bot
- Loading branch information
Showing
13 changed files
with
36 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,29 @@ | ||
const path = require('path') | ||
const log4js = require('log4js') | ||
const dir = process.cwd() | ||
|
||
log4js.configure({ | ||
appenders: { | ||
console: { type: 'console' }, | ||
app: { | ||
type: 'dateFile', | ||
maxLogSize: "10M", | ||
filename: path.join(dir, "./data/logs/app.log") | ||
} | ||
}, | ||
categories: { | ||
default: { | ||
appenders: ['console'], level: 'trace',//all log | ||
module.exports = function logger(config) { | ||
console.log('config', config) | ||
log4js.configure({ | ||
appenders: { | ||
console: { type: 'console' }, | ||
app: { | ||
type: 'dateFile', | ||
maxLogSize: "10M", | ||
filename: path.join(dir, "./data/logs/bot-" + config.user + ".log") | ||
} | ||
}, | ||
app: { | ||
appenders: ['app'], level: 'debug', | ||
categories: { | ||
default: { | ||
appenders: ['console'], level: 'trace',//all log | ||
}, | ||
app: { | ||
appenders: ['app'], level: 'debug', | ||
}, | ||
}, | ||
} | ||
}) | ||
|
||
const logger = log4js.getLogger("app") | ||
module.exports = logger | ||
pm2: config.with_server | ||
}) | ||
|
||
const logger = log4js.getLogger("app") | ||
return logger | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters