Logger not closing outputs when deleted

- The logger must close the outputs when deleted, otherwise we will
  have files not closed, and because of that, invalid compressed files.