Log error in file