Added checks on logStream at creation, and close logStream at shutDown