mirror of
https://github.com/aurora-dot/pastel.codes.git
synced 2024-11-22 16:22:20 +00:00
E
8449b30401
* Add dev-dependancies * Security update npm packages * Force audit fix * Add linting, formatting and precommit * Format files
31 lines
645 B
JavaScript
31 lines
645 B
JavaScript
var winston = require('winston');
|
|
var appRoot = require('app-root-path');
|
|
|
|
var logger = new winston.createLogger({
|
|
transports: [
|
|
new winston.transports.File({
|
|
level: 'info',
|
|
filename: `${appRoot}/logs/app.log`,
|
|
handleExceptions: true,
|
|
json: true,
|
|
maxsize: 5242880, //5MB
|
|
maxFiles: 5,
|
|
colorize: false,
|
|
}),
|
|
new winston.transports.Console({
|
|
level: 'debug',
|
|
handleExceptions: true,
|
|
json: false,
|
|
colorize: true,
|
|
}),
|
|
],
|
|
exitOnError: false,
|
|
});
|
|
|
|
logger.stream = {
|
|
write: function (message, _encoding) {
|
|
logger.info(message);
|
|
},
|
|
};
|
|
module.exports = logger;
|