When possible, include filename for failed writes

When a destination file cannot be written, include its filename in logging output.