you doing it in right way, but yes it maybe failing because of special characters.
would be better if you share the adapter responses you are trying to write to file.
I write my adapter responses into a new file each time and use epoch_adapter-name.log as the file name. It's easier for me to consume later.
So far I had no issues.
Will share the response shortly but is there any way to escape special characters from the text content that i extract from xml response.
the File Adapter if using the "line 1/2/3 .." Context Items as inputs does not like return characters i.e. each line should be a single line entry to the file.
I you want to append a large document, you can use the XML format.
Richards XML Utilities module contains workflow to encode/decode special characters.