473,387 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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?
Jan 13 '06 #1
2 9304
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 ***
Jan 13 '06 #2
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 ***

Jan 13 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian Rupert | last post by:
Can someone tell me where this info is? I currently have my ROOT application pool assigned to another web site's path. Not sure how it happened. Is there a way to change this in IIS? Or, can any...
1
by: denis_bernicky | last post by:
I have been given a database on a CD to do some work on. The only problem is that when I open a form it tells me that the file path //server/database/mydb.mdb is not valid. Of course it isn't...
0
by: svilst | last post by:
How can I change the path of the cookie 'ASP.NET_SessionId'? The path is "/" and I'd like to set the path to particular virtual directory. The following approach does not work: protected void...
19
by: Ju Hui | last post by:
is python search module by paths in sys.path? how to change it manuallly?
3
by: sk.rasheedfarhan | last post by:
Hi all, According to my project requirement I have to write the NT Event information of SQL Server into EventLog viewer. For more clear I want to write the following information into...
1
by: ABC | last post by:
What is the system requirements to write RFID application using C#?
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
2
myusernotyours
by: myusernotyours | last post by:
Hi there all, I have been contracted to write an application that can run on linux or windows, I have heard that Java is platform indepedent but am wondering whether if i use java and my windows os...
4
by: trouty | last post by:
My company wants me to write an application that generates a password from a five character string that the user enters. This is for security reasons for employees that have to enter the building on...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.