You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
579 B
25 lines
579 B
const path = require('path'); |
|
const pino = require('pino'); |
|
const config = require('../config'); |
|
|
|
const logDir = path.join(__dirname, '../../logs'); |
|
|
|
module.exports = pino({ |
|
level: config.logLevel, |
|
transport: { |
|
targets: [ |
|
// 콘솔 출력 |
|
{ |
|
target: 'pino-pretty', |
|
options: { colorize: true }, |
|
level: config.logLevel, |
|
}, |
|
// 파일 출력 (logs/app.log) |
|
{ |
|
target: 'pino/file', |
|
options: { destination: path.join(logDir, 'app.log'), mkdir: true }, |
|
level: config.logLevel, |
|
}, |
|
], |
|
}, |
|
});
|
|
|