Gary,
Thanks for the response. we raise events as follows:
Private Shared _defaultLevel As EventLevel = EventLevel.Error
Public Shared Sub Publish(ByVal ex As Exception, ByVal message As
String)
Dim messageEvent As New ErrorMessageEvent
Dim detail As String = ""
If Not ex Is Nothing Then
detail = FormatException(ex) & NewLine & message
Else
detail = "Missing exception." & NewLine & message
End If
messageEvent.Message = detail
messageEvent.EventPublishLogLevel = CInt(DefaultLogLevel)
EventSource.Application.Raise(messageEvent)
end sub
We are using .NET v1.1, running on Windows2003, using:
Microsoft.ApplicationBlocks.Common.dll
Microsoft.ApplicationBlocks.Logging.EventSinks.dll
Microsoft.ApplicationBlocks.Logging.Schema.dll
and of course the EIF.
We did not modify the code in these applications. We use config
information of:
WEB.Config:
<section name="eventFormatterSettings"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.FormatterConfigHandler,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3" />
<appsettings>
<add key="applicationLogLevel" value="error" />
</appsettings>
<eventFormatterSettings>
<!-- This formatter is used by the Metering
Publisher to
format the information that goes into the metering event
before
raising it to the event sink -->
<formatterInfo name="meteringFormatXslt"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3"
fullyQualifiedDefaultXsltPath="eventlogmeteringtransform_plaintext.xslt"
/>
<!-- This formatter is used by the EIF -->
<formatterInfo name="logSinkXslt"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3"
fullyQualifiedDefaultXsltPath="eventlogtransform.xslt" />
<formatterInfo name="basiclogSinkXslt"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3"
fullyQualifiedDefaultXsltPath="eventlogtransform.xslt" />
<formatterInfo name="meteringlogSinkXslt"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3"
fullyQualifiedDefaultXsltPath="eventlogmeteringtransform.xslt" />
<formatterInfo name="msmqSinkXslt"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3"
fullyQualifiedDefaultXsltPath="eventmsmqtransform.xslt" />
<formatterInfo name="sqlSinkXslt"
type="Microsoft.ApplicationBlocks.Logging.EventSinks.XsltEventFormatter,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3"
fullyQualifiedDefaultXsltPath="c:\Projects\GMIStandard\SharedFiles\StyleSheets\eventsqltransform.xslt"
/>
</eventFormatterSettings>
Finally, we also have a Enterprise Config with:
<filters>
<filter name="defaultSoftwareElementFilter"
description="A default filter for the Software Element
event sources.">
<eventCategoryRef name="All Events">
<eventSinkRef name="logSink" />
<eventSinkRef name="sqlSink" />
</eventCategoryRef>
</filter>
</filters>
<eventSink name="logSink" description="Outputs events to the
Windows Event Log."
type="Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink">
<parameter name="entryTypeFieldName" value="EventLogEntryTypeID"
/>
<parameter name="defaultEntryType" value="Information" />
<parameter name="machineName" value="." />
</eventSink>
<eventSink name="sqlSink" description="Outputs events to the Sql
Server flexible Log."
type="Microsoft.ApplicationBlocks.Logging.EventSinks.SqlServerEventSink,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3">
<parameter name="connectionString"
value="Password=VMKDSIAGFIO887;Persist Security Info=True;User
ID=MWEB033;Initial Catalog=DWEB_ERR;Data Source=JFBDBSCT1-V1\T1" />
<parameter name="numberOfRetries" value="0" />
<parameter name="formatterName" value="sqlSinkXslt" />
</eventSink>
I hope some of this helps.
Thanks,
Patrick
>Hi Patrick,
>
[quoted text clipped - 17 lines]
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
Gary Chang[MSFT] - 15 Mar 2005 06:38 GMT
Hi Patrick,
Thanks for your code snippet!
..
<eventSink name="logSink" description="Outputs events to the Windows Event
Log."
type="Microsoft.EnterpriseInstrumentation.EventSinks.LogEventSink">
<parameter name="entryTypeFieldName" value="EventLogEntryTypeID"/>
<parameter name="defaultEntryType" value="Information" />
<parameter name="machineName" value="." />
</eventSink>
<eventSink name="sqlSink" description="Outputs events to the Sql Server
flexible Log."
type="Microsoft.ApplicationBlocks.Logging.EventSinks.SqlServerEventSink,
Microsoft.ApplicationBlocks.Logging.EventSinks, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=3223a35ad8aa5af3">
<parameter
name="connectionString"value="Password=VMKDSIAGFIO887;Persist Security
Info=True;User ID=MWEB033;Initial Catalog=DWEB_ERR;Data
Source=JFBDBSCT1-V1\T1" />
<parameter name="numberOfRetries" value="0" />
<parameter name="formatterName" value="sqlSinkXslt" />
</eventSink>
..
Concidered the code above, since you specified the "formatterName" for your
SQL Server sink, it appears the applcation name will not be transformed
automatically. SoI think you can try to provide the application name to
your message event explicitly:
messageEvent.ApplicationName = YourAppName;
Wish this helps!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.
patrick.philipp@genmills.com - 17 Mar 2005 14:23 GMT
Thanks, I got the system to work now.
Patrick
>Hi Patrick,
>
[quoted text clipped - 20 lines]
>
>This posting is provided "AS IS" with no warranties, and confers no rights.
Gary Chang[MSFT] - 18 Mar 2005 06:55 GMT
Great Patrick,
thanks for this update, wish you have a nice weekend!
Best regards,
Gary Chang
Microsoft Community Support
--------------------
Get Secure! ??C www.microsoft.com/security
Register to Access MSDN Managed Newsgroups!
http://support.microsoft.com/default.aspx?scid=/servicedesks/msdn/nospam.asp
&SD=msdn
This posting is provided "AS IS" with no warranties, and confers no rights.