Added log writing to batch shell