Logging to file implemented