gilalig
asked on
Create a log file for a web server from a web service
Hello,
I need to write to a file in order to log values received through a web service in ASP.NET/VB.Net. This file must be on the web server . What code can I write for this in the web service ?
Attached is what I have written but I'm not sure if it is good for a web server or only when working with localhost.
Thanks
I need to write to a file in order to log values received through a web service in ASP.NET/VB.Net. This file must be on the web server . What code can I write for this in the web service ?
Attached is what I have written but I'm not sure if it is good for a web server or only when working with localhost.
Thanks
strWriteLog = "LogDateTime:" & Date.Now.ToString & " Key:" & sKey & " UpdateDate:" & Rec.UpdateDate
My.Computer.FileSystem.WriteAllText("C:\inetpub\wwwroot\site\myDir\Files\traceDates.txt", strWriteLog, True)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Can the streamwriter be used for a file on the web server - not the localhost?
Thanks!
Thanks!
Diagnostics.EventLog.Write
It will track your times, etc.
Just a thought.