EventLoh issue !

  • Thread starter One Handed Man [ OHM# ]
  • Start date
O

One Handed Man [ OHM# ]

I'm stuck on something stupid. I thought this code would generate events in the windows event log under the Superanuation Log heading. However, it does not. I found if I use the EventLog.writeEntry method to get a register of the message on the log. I'm a bit onfused with this because the EventLog class has a message container, where all the items are stored from by the listener, I would have thought that this would auto write to the log.

I know I'm tired and simply missing the right way to do this, someone help me clear the mist please !

Regards - A very Nackered - OHM

Dim myLog As New EventLog("Superannuation Log")
myLog.Source = "Trace Output"

Try

Dim myListener As New EventLogTraceListener(myLog)
Trace.AutoFlush = True
Dim x As Integer
For x = 10000 To 500000 Step 5000
Trace.WriteLine(x.ToString)
Trace.Flush()
Next
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try
 
O

One Handed Man [ OHM# ]

Someone must know how to do this ?

I'm stuck on something stupid. I thought this code would generate events in the windows event log under the Superanuation Log heading. However, it does not. I found if I use the EventLog.writeEntry method to get a register of the message on the log. I'm a bit onfused with this because the EventLog class has a message container, where all the items are stored from by the listener, I would have thought that this would auto write to the log.

I know I'm tired and simply missing the right way to do this, someone help me clear the mist please !

Regards - A very Nackered - OHM

Dim myLog As New EventLog("Superannuation Log")
myLog.Source = "Trace Output"

Try

Dim myListener As New EventLogTraceListener(myLog)
Trace.AutoFlush = True
Dim x As Integer
For x = 10000 To 500000 Step 5000
Trace.WriteLine(x.ToString)
Trace.Flush()
Next
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try







--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> wrote in message I'm stuck on something stupid. I thought this code would generate events in the windows event log under the Superanuation Log heading. However, it does not. I found if I use the EventLog.writeEntry method to get a register of the message on the log. I'm a bit onfused with this because the EventLog class has a message container, where all the items are stored from by the listener, I would have thought that this would auto write to the log.

I know I'm tired and simply missing the right way to do this, someone help me clear the mist please !

Regards - A very Nackered - OHM

Dim myLog As New EventLog("Superannuation Log")
myLog.Source = "Trace Output"

Try

Dim myListener As New EventLogTraceListener(myLog)
Trace.AutoFlush = True
Dim x As Integer
For x = 10000 To 500000 Step 5000
Trace.WriteLine(x.ToString)
Trace.Flush()
Next
Catch ex As Exception
Trace.WriteLine(ex.ToString)
End Try
 
A

Armin Zingler

"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> schrieb

Maybe
Content-Type: text/html;
is the problem.

Or is this a web server? ;-)))
 
O

One Handed Man [ OHM# ]

Thanx guys, basically, this seems to be a cr*ppy solution really. It to me
looks ill thought out by microsoft.

Cheers - Anyway
 
H

Herfried K. Wagner [MVP]

* "Armin Zingler said:
Maybe
Content-Type: text/html;
is the problem.

Or is this a web server? ;-)))

I remember I already pointed that out in an other thread started by
OHM...

:-(
 
O

One Handed Man [ OHM# ]

Armin, I'm not sure how your post helps really. The point is that the
EventLog Class does not seem to work in a sensible way. To me it defies the
perceived logic of how it should work.

I would have expected the EventLog to have received messages directly once a
listener was in place. This does not happen and that is my point.

And no, this is not a web server

Regards - OHM


Armin said:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> schrieb

Maybe
Content-Type: text/html;
is the problem.

Or is this a web server? ;-)))
 
A

Armin Zingler

One Handed Man said:
Armin, I'm not sure how your post helps really.

It _might_ give you _one_ reason why nobody answers and enables you to
change it.

The simple reason why _I_ didn't give an answer was that I don't have one.
 

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

Top