You could use the Uri Helper:
1st Option - Quick Extract of Host
string sHost = (new Uri("net.tcp://ERPSERVERNAME/EpicorApplicationInstance")).Host; // Output: ERPSERVERNAME
string sHost = (new Uri( ((Ice.Core.Session)oTrans.Session).AppServer) )).Host; // Output: ERPSERVERNAME
2nd Option - Create Object
var url = new Uri("net.tcp://ERPSERVERNAME/EpicorApplicationInstance");
url.Host // ERPSERVERNAME
url.AbsoluteUri // EpicorApplicationInstance
url.Port // 808
url.Scheme // net.tcp
Easy Path Concat
string sLogFile = System.IO.Path.Combine(@"\\"+ sHost, "EpicorData", "CustomLog.log");
More info for anyone who hasn’t used it yet
System.IO.Path.Combine(@"C:\abc", "MyFileName.xml") // C:\abc\MyFileName.xml
System.IO.Path.Combine(@"C:\abc\", "MyFileName.xml") // C:\abc\MyFileName.xml
System.IO.Path.Combine(@"\\SERVERPATH", "MyFileName.xml") // \\SERVERPATH\MyFileName.xml
System.IO.Path.Combine(@"\\SERVERPATH\", "MyFileName.xml") // \\SERVERPATH\MyFileName.xml