Results 1 to 8 of 8

Thread: Need Help writing to event log.

  1. #1

    Thread Starter
    New Member MDTech.us_MAN's Avatar
    Join Date
    Aug 2012
    Posts
    15

    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.

  2. #2
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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?

  3. #3

    Thread Starter
    New Member MDTech.us_MAN's Avatar
    Join Date
    Aug 2012
    Posts
    15

    Re: Need Help writing to event log.

    Quote Originally Posted by DataMiser View Post
    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.

  4. #4
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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?

  5. #5

    Thread Starter
    New Member MDTech.us_MAN's Avatar
    Join Date
    Aug 2012
    Posts
    15

    Re: Need Help writing to event log.

    Quote Originally Posted by DataMiser View Post
    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.

  6. #6
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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.

  7. #7

    Thread Starter
    New Member MDTech.us_MAN's Avatar
    Join Date
    Aug 2012
    Posts
    15

    Re: Need Help writing to event log.

    Quote Originally Posted by DataMiser View Post
    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.Name:  new-year-image.jpg
Views: 239
Size:  15.9 KB

  8. #8
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,206

    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
  •  



Click Here to Expand Forum to Full Width