Added a file logging method