Change the write path for My.Application.Log.WriteEntry?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've been working with the My.Application.Log.WriteEntry method in VB.net
2005 and when it writes a log is stores the log file in the application data
folder under the systems user account. I have tried to find a way to change
this path to save the log to a different location but i can't find it. Has
anyone dealt with this b4? I have read the MSDN documentation and searched
online but have been unsuccesful in finding any way to do this. Any
suggestions?
 
I have always used a simple log routine that writes to a log file in my
application's directory.

Private Sub WriteLogEntry(ByVal msg as String)
dim sw as new StreamWriter(".\myapp.log",True)
sw.writeline(now.toshortdatestring & " " & _
now.toshorttimestring & " - " & msg)
sw.close
End Sub
 
Terry thank you for responding to my post.
I agree that your solution for creating my own log files will do what i need
it to do and I will most likely end up doing it that way if i can't find an
answer. I'm specifically interested in the My.Application.Log.WriteEntry to
see if I wanted to change the way i was doing things and while i do like the
method, I don't like that i can't change the path of where it writes the log
and wanted to see if anyone has solved it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top