Refer to the exhibit.
```python
for log in logs:
if 'error' in log:
print(log)
```
A SOC engineer is attempting to automate a recurring log-analysis task. What modification must be made to the provided Python script to automatically save the output to a file rather than display it?