Welcome Mickey!
Generally, I would say don’t write files on your servers if you can help it. If you’re just debugging, do what @banderson suggested. If you want to write traces, check this out:
How to write your own trace logs - Experts’ Corner - Epicor User Help Forum (epiusers.help)
If you really, really, really want to write files, use the Ice.Lib.ServerPath service to get a reference to a folder within EPICORDATA.
10.2.600 & AR Invoice Form - ERP 10 - Epicor User Help Forum (epiusers.help)