By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,234 Members | 1,869 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,234 IT Pros & Developers. It's quick & easy.

Event Log issue ! - My Turn

P: n/a
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 news:ul**************@TK2MSFTNGP11.phx.gbl...
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

Nov 20 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
Cor
Hi OHM,

I never did something with the EventsLogs but I knew someone who loves them.
And he did spent a lot of them with the Events log because he did not get it
as he wanted, but I thought at last he got it.

I have looked up from him something on the google newsgrous, there were only
two answers, but his answers are mostly complete.

http://groups.google.com/groups?hl=e...languages.vb.*

Cor
Nov 20 '05 #2

P: n/a
"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? ;-)))
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #3

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

Cheers - Anyway
Cor wrote:
Hi OHM,

I never did something with the EventsLogs but I knew someone who
loves them. And he did spent a lot of them with the Events log
because he did not get it as he wanted, but I thought at last he got
it.

I have looked up from him something on the google newsgrous, there
were only two answers, but his answers are mostly complete.

http://groups.google.com/groups?hl=e...languages.vb.*
Cor


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #4

P: n/a
* "Armin Zingler" <az*******@freenet.de> scripsit:
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...

:-(

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #5

P: n/a
I dont remember starting any thread on this subject before !

Herfried K. Wagner [MVP] wrote:
* "Armin Zingler" <az*******@freenet.de> scripsit:
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...

:-(


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #6

P: n/a
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 Zingler wrote:
"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? ;-)))


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #7

P: n/a
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> schrieb
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.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #8

P: n/a
OK, then Im sorry if I upset you.
Regards - OHM

Armin Zingler wrote:
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> schrieb
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.


--
Best Regards - OHM

O_H_M{at}BTInternet{dot}com
Nov 20 '05 #9

P: n/a
"One Handed Man [ OHM# ]" <O_H_M{at}BTInternet{dot}com> schrieb
OK, then Im sorry if I upset you.


You didn't.
--
Armin

Nov 20 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.