|
-
Dec 31st, 2012, 03:34 PM
#1
Thread Starter
New Member
Need Help writing to event log.
Hello All,
I need help writing to the event log.
The problem I ran into is writing to a folder under Applications and Services. Here is the path I want to write to:
Code:
Event Viewer (Local)\Applications and Services\MDTech\Program Name\
I can't find a way to create a sub folder and write to it!
Maxwell.
P.S. Happy New Year!
Last edited by MDTech.us_MAN; Dec 31st, 2012 at 08:26 PM.
-
Dec 31st, 2012, 04:15 PM
#2
Re: Need Help writing to event log.
How are you attempting to write to it now and from what type of application? Which version of VB/framework are you using?
-
Dec 31st, 2012, 05:01 PM
#3
Thread Starter
New Member
Re: Need Help writing to event log.
 Originally Posted by DataMiser
How are you attempting to write to it now and from what type of application? Which version of VB/framework are you using?
1) This is a new program so I don't write to the event log at all now. But, I will most likely use the EventLog type.
2) I am using VB.NET 2012, but with the target framework set to 4.0.
Maxwell.
P.S. Happy New Year!
Last edited by MDTech.us_MAN; Dec 31st, 2012 at 08:26 PM.
-
Dec 31st, 2012, 06:51 PM
#4
Re: Need Help writing to event log.
What type of application? Is it a Service, a console app, a windows forms app web service... or what?
-
Dec 31st, 2012, 08:26 PM
#5
Thread Starter
New Member
Re: Need Help writing to event log.
 Originally Posted by DataMiser
What type of application? Is it a Service, a console app, a windows forms app web service... or what?
It actually is a service, but I think everything that works on a win forms app also works on services.
Maxwell.
P.S. Happy New Year!
Last edited by MDTech.us_MAN; Dec 31st, 2012 at 09:44 PM.
-
Jan 1st, 2013, 02:57 PM
#6
Re: Need Help writing to event log.
I'm confused if you are not writing to the event log at all then what problem are you having? Have you tried anything?
The process is pretty simple, just add the Event Log to your service and write to it
Code:
Me.EventLog.WriteEntry("Input path=" & WatchPath & vbCrLf & "Extension=" & WatchExtension)
I'm not sure what you mean by the path.
-
Jan 1st, 2013, 04:00 PM
#7
Thread Starter
New Member
Re: Need Help writing to event log.
 Originally Posted by DataMiser
I'm confused if you are not writing to the event log at all then what problem are you having? Have you tried anything?
The process is pretty simple, just add the Event Log to your service and write to it
Code:
Me.EventLog.WriteEntry("Input path=" & WatchPath & vbCrLf & "Extension=" & WatchExtension)
I'm not sure what you mean by the path.
I am trying to create an event not under the Application log but under a separate log that I also want to use for any future programs. Such as Microsoft's services write to a separate log under the Microsoft folder.
Maxwell.
P.S.
-
Jan 1st, 2013, 05:36 PM
#8
Re: Need Help writing to event log.
Perhaps you can use the info here http://www.codeguru.com/columns/vb/a...s-in-VBNET.htm to do what you need.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|