EntLib 4.1 Logging: uncomplete entry in Eventlog

Topics: Logging Application Block
Jul 17, 2009 at 8:59 AM

Hello

I'm new in this group and new with Entlib 4.1.

I have a client/server application, I need an global logging.

I build a Windowsservice which uses the logging application block from the Entlib. I use WCF over netMsmqBinding for the sending the Log-Message. On my development pc everything is fine (WIN XP). But if the service is running on an another pc (win2003) the body of the Eventlogentry is very different.

on development pc:

Timestamp: 16.07.2009 14:52:45
Category: General
Title:testegb
Message: Funktionsname: Testfunktion
Arbeitsschritt: 1. Schritt
Rechnername: localhorst
lngEreignistyp: 1
Protokollstufe: 2
Status: 5
SessionID: 3
QueueID: 4
lngGBID: 6
lngETID: 7
Zusatzinformation:Ich sag nichts - Zeitstempel: 16.07.2009 16:52:45
Priority: 1
EventId: 111
Severity: Information
Machine: UL20030029
Application Domain: EGB_GlobalLogging.exe
Process Id: 2500
Process Name: C:\quellen\PRS\branches\EGB_UtimacoAbloesung\Serverkomponenten\EGB_GlobalLogging\EGB_GlobalLogging\bin\Debug\EGB_GlobalLogging.exe
Win32 Thread Id: 2908
Thread Name:
)}

Weitere Informationen über die Hilfe- und Supportdienste erhalten Sie

 

on test pc

Test111

 

Only the EventId is coming. The word 'Test' was not sent with the call. The calling methode is named Test.

To verify the 'transport' I added a FlatFile TraceListener. In the trace file is everything ok.

Any ideas

 

Thanks

Andreas

Jul 17, 2009 at 9:22 AM

Please clarify, what is the information logged in your test pc?  What is Test111?  Does it correspond to a specific field in the log entry?

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Jul 17, 2009 at 10:04 AM

Hallo

to write into the log I use this

Write(Object, String, Int32, Int32, TraceEventType, String) Write a new log entry with a specific category, priority, event id, severity and title. (from online doku)

this is the from my code: Logger.Write((object)Meldung, Category, lngEreignistyp, 111, tracetype, "testegb");

(object)Meldung ist a stringbuilder variable which contains this value

Message: Funktionsname: Testfunktion
Arbeitsschritt: 1. Schritt
Rechnername: localhorst
lngEreignistyp: 1
Protokollstufe: 2
Status: 5
SessionID: 3
QueueID: 4
lngGBID: 6
lngETID: 7
Zusatzinformation:Ich sag nichts - Zeitstempel: 16.07.2009 16:52:45

 

Category has the value "General"
there is a Category Source which is named General

lngEreignistyp has the value 1 -> priority

111  -> event id

tracetype has the value System.Diagnostics.TraceEventType.Information -> severity

"testegb" -> title

 

Test111 is a bit strange. I don't know the source of this value. I think 111 is from the event id, And I don't know from which source is the word Test

 

I hope it is now better descripted

Andreas

Jul 17, 2009 at 10:11 AM

You may be encountering permission issue when writing to event log, refer to this thread - http://entlib.codeplex.com/Thread/View.aspx?ThreadId=56632

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.

entlib.support@avanade.com

Jul 17, 2009 at 11:09 AM

Hello

i will try it.

Thanks

Andreas

Jul 17, 2009 at 12:31 PM

Hallo again

I don't think it is an permission problem. I tryed some modification which was described in the thread - http://entlib.codeplex.com/Thread/View.aspx?ThreadId=56632

The 2. point is, the Service which is writing into the eventlog is running with the account NT AUTHORITY\NetworkService, I tryed also LocalSystem Account.

And the 3. point, I run my testprogram on the test pc, not remote - same problem.

Any ideas

 

Thanks

Andreas

Jul 20, 2009 at 3:02 PM

Hello

FYI, I found the problem.

In the configuration for the Formatted EventLog TraceListener, I used 'EGB' as the source, I thought this is only a description and not an precise 'object'. But on my PC was a event source named EGB. This evnet source writes Test111 to the detail of the logging. I change the source to a event source which points to Eventlogmessages.dll in the .net framework

kind regards

Andreas