using try-with-resource, updating loggers