Do not continue writing after stream has closed
This commit is contained in:
parent
83593a3216
commit
b31a44aa76
2 changed files with 16 additions and 0 deletions
|
@ -69,6 +69,14 @@ export async function initialize(): Promise<pinoms.Logger> {
|
|||
rotate: 3,
|
||||
});
|
||||
|
||||
stream.on('close', () => {
|
||||
globalLogger = undefined;
|
||||
});
|
||||
|
||||
stream.on('error', () => {
|
||||
globalLogger = undefined;
|
||||
});
|
||||
|
||||
const streams: pinoms.Streams = [];
|
||||
streams.push({ stream });
|
||||
|
||||
|
|
|
@ -112,6 +112,14 @@ export function initialize(): void {
|
|||
rotate: 3,
|
||||
});
|
||||
|
||||
stream.on('close', () => {
|
||||
globalLogger = undefined;
|
||||
});
|
||||
|
||||
stream.on('error', () => {
|
||||
globalLogger = undefined;
|
||||
});
|
||||
|
||||
globalLogger = pino(
|
||||
{
|
||||
timestamp: pino.stdTimeFunctions.isoTime,
|
||||
|
|
Loading…
Reference in a new issue