Added proper file logging