To fix: Add file.getParentFile().mkdirs(); Also make sure that the logger is initialised BEFORE trying to log the failure!