Added logging for closing of documents