Enable line buffering for output logs
By default opened files have buffering=-1 which uses default system buffering (usually fully buffered). This can be annoying for logs which we hope to read while the process is running. Change the buffering mode to 1 which is line buffering, it should flush whenever a \n is seen.