added write-to-disk for the error logs