Close connection on unload.
Add some meta data to log.