Another option is to set the bufferSize of the FileHandler to 0.
bufferSize
FileHandler
0
const applicationLoggerHandler = new FileHandler("DEBUG", { filename: logDir + "/application.log", formatter: "{msg}", bufferSize: 0, });