log to file
This commit is contained in:
parent
56266b4872
commit
ee2415f454
|
@ -4,10 +4,10 @@ import { fileURLToPath } from 'url';
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
// const fileTransport = pino.transport({
|
const fileTransport = pino.transport({
|
||||||
// target: 'pino/file',
|
target: 'pino/file',
|
||||||
// options: { destination: `${__dirname}/app.log` },
|
options: { destination: `${__dirname}/app.log` },
|
||||||
// });
|
});
|
||||||
|
|
||||||
export default pino({
|
export default pino({
|
||||||
level: process.env.PINO_LOG_LEVEL || 'trace',
|
level: process.env.PINO_LOG_LEVEL || 'trace',
|
||||||
|
@ -17,4 +17,6 @@ export default pino({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
timestamp: pino.stdTimeFunctions.isoTime,
|
timestamp: pino.stdTimeFunctions.isoTime,
|
||||||
})
|
},
|
||||||
|
fileTransport
|
||||||
|
)
|
Loading…
Reference in New Issue