Roman,
Here is another thought:
Why not send the filtered message to another thread which is your error file thread (file protocol maybe)?
You still need a filter proc (there are generic ones around) but let Cloverleaf manage the I/O, get the assured delivery, have SMAT, all that good stuff.
Jim Kosloskey
email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.