Skip to content

Commit

Permalink
fix: only log errors !== ENOENT
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Feb 19, 2024
1 parent a8f9c8d commit d851fa9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,9 @@ function setupCleanJob(settings: DailyRotateFileTransportOptions) {
const deleteFile = async (filePath: string) => {
logger.info(`Deleting log file: ${filePath}`)
return unlink(filePath).catch((e) => {
logger.error(`Error deleting log file: ${filePath}`, e)
if (e.code !== 'ENOENT') {
logger.error(`Error deleting log file: ${filePath}`, e)
}
})
}

Expand Down

0 comments on commit d851fa9

Please sign in to comment.