Write stack trace to console when a buildinaccessibleexception occurs
Close file handle of old log when switching logs between days.