Groups | Blog | Home
all groups > visual studio .net enterprise tools > february 2004 >

visual studio .net enterprise tools : Logging AB Questions (custome event log)


John Dhom
2/20/2004 5:01:28 PM
How do I get the Logging AB to write LogEventSink stuff to a Custom Event
Log (i.e. My Event Log)? The default ResourceTable.EventlogLogName is
"application". I couldn't sort out what <parameter> might map to
EventlogLogName (or other that affects chage to default).

Also, what is the recommended way to get event log stuff like category,
event id, user, etc. filled out? Do I need to use a filter? Oh, source is
displayed as "Application(MySource)"... I saw
ResourceTable.ApplicationSource, but again don't know how to configure it
(<parameter> or other).

Not a bad 1st outing... got the EIF/Logging block built, configured, and
integrated into an app in a couple hours. So, take pitty on this noob and
point him in the right direction.

Best,
/jhd

John Dhom
3/9/2004 9:30:03 AM
Hello? Is this thing working?

/jhd

[quoted text, click to view]

mikehayt_ NO[at]SPAM online.microsoft.com
3/9/2004 9:20:02 PM
I dont know the answer to the question below. But I do know that there was
a separate thread about logging block questions where the team the produced
the logging block (a different one from EIF) said:

For any feedback to this please send to devfdbck@microsoft.com. We
(patterns & practices [1] )developed these extensions to EIF and would like
to here any feedback or help in anyways we can.

The title of the thread was "Please read for info on Logging Application
Block (Extensions to EIF)" from Scott Densmore (scottden@microsoft.com).

I suggest that you email them directly and tell them your opinion/question.
Perhaps you could post their reply?
Maybe you might like to suggest that they check this newsgroup and reply to
the logging block questions directly?

Sorry I couldnt be of more help

Mike
--------------------
|
| Hello? Is this thing working?
|
| /jhd
|
[quoted text, click to view]
| > How do I get the Logging AB to write LogEventSink stuff to a Custom
Event
| > Log (i.e. My Event Log)? The default ResourceTable.EventlogLogName is
| > "application". I couldn't sort out what <parameter> might map to
| > EventlogLogName (or other that affects chage to default).
| >
| > Also, what is the recommended way to get event log stuff like category,
| > event id, user, etc. filled out? Do I need to use a filter? Oh, source
is
| > displayed as "Application(MySource)"... I saw
| > ResourceTable.ApplicationSource, but again don't know how to configure
it
| > (<parameter> or other).
| >
| > Not a bad 1st outing... got the EIF/Logging block built, configured, and
| > integrated into an app in a couple hours. So, take pitty on this noob
and
| > point him in the right direction.
| >
| > Best,
| > /jhd
| >
| >
|
|
|

--

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
John Dhom
3/24/2004 9:48:38 AM
Hi Mike,

Thanks much... at least it's a starting point ;)

/jhd

[quoted text, click to view]

John Dhom
3/24/2004 9:50:14 AM
Hi Shameless,

Thanks info/link. I'll put this to good use ;)

/jhd

[quoted text, click to view]

Juan Ignacio Gelos
3/24/2004 10:50:15 AM
This is a shameless copy&paste from the Microsoft Patterns & Practices
Exception Management & Instrumentation Workspace Message board at GotDotnet:
(pasted from
http://www.gotdotnet.com/Community/MessageBoard/Thread.aspx?id=158195)


Author: nyajaman (Microsoft)
Logging Application Block: eventlog name
Posted on: 11/02/2003 18:39:50

The changes needed to support this are pretty trivial but the implications
can be far reaching.

Changes needed to support this:

1. In the EIF Config file add a parameter entry:

<eventSink name="logSink" description="Outputs events to the Windows Event
Log." type="Microsoft.ApplicationBlocks.Logging.EventSinks.LogEventSink,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=1237373737abc111">
<!-- other parameters -->
<parameter name="eventLogName" value="MyApplicationLog" />
</eventSink>

2. In the LogEventSink.cs file:

public LogEventSink(IDictionary parameters, EventSource eventSource) :
base(parameters, eventSource) {

/* other code */

this.logName = (string) parameters["eventLogName"];

/* other code */
}

3. Implications:

Supporting Event Log being passed as a parameter can be challenging:

1. Changing the Eventlog to Event Source mapping does not take effect until
there is a machine reboot.
2. You can run into a crazy (serious) situation where the user changes the
log in the config and does not reboot the machine then since the source is
mapped to a different log and that change has not taken effect the events
will not appear in either of logs and will be lost.
This is a decision you need to make - This provides considerable flexibility
and there are some valid scenarios (each application using a different log)
for this but in the same vein you can create havoc for a single application.

Thanks.


Disclaimer: This posting is provided "AS IS" with no warranties, and confers
no rights.









[quoted text, click to view]

John Dhom
4/12/2004 10:06:22 AM
Just reporting back... I have LAB talking to my custom event log now. Turns
out my hard-coded hack was in the right place... but I didn't fully
understand the registration/re-boot cycle :(

I've updated my hack to use a parameter per discussion thread.
EventSinks.dll deployed locally (actually common for the suite) and
EventSchema registered to the gac. All seems well.

/jhd

[quoted text, click to view]

AddThis Social Bookmark Button