Write to file directly instead of invoking the file transport.
Refactoring out the logToFile() method.