PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Change the write path for My.Application.Log.WriteEntry?
Forums
Newsgroups
Microsoft DotNet
Microsoft VB .NET
Change the write path for My.Application.Log.WriteEntry?
![]() |
Change the write path for My.Application.Log.WriteEntry? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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? |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 *** Sent via Developersdex http://www.developersdex.com *** |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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? "Terry Olsen" wrote: > 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 > > *** Sent via Developersdex http://www.developersdex.com *** > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

