I have a class library which is deployed on an ISP server to be consumed by an ASP.NET web service. I’d like to keep track of any errors and in this case the windows event log is inaccessible to me. So I thought I’d write to a txt file using the StreamWriter class. Problem is if I don’t give an absolute path and just a file name it tries to write to C:\Windows\System32, and that’s no good to me.
How can I tell it to use maybe the data directory or the application root? Any thoughts?
I have a class library which is deployed on an ISP server to be
Share
Here is what I used to use, it’s a little clunky but it gets the job done:
I had this class in it’s own project, separate from the website itself, and I used it in all of my other non website projects…
Edit:
Btw LogSeverity is just an enum I made up…