Thanks info/link. I'll put this to good use ;)
"Juan Ignacio Gelos" <msnews@juanignaciogelos.com> wrote in message
news:eoxVxbaEEHA.2968@TK2MSFTNGP12.phx.gbl...
> 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.
>
>
>
>
>
>
>
>
>
> "John Dhom" <a@b.c> wrote in message
> news:OPIp8VA#DHA.3848@TK2MSFTNGP10.phx.gbl...
> > 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
> >
> >
>
>