Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Enterprise Tools / March 2005

Tip: Looking for answers? Try searching our database.

Problem With ApplicationBlock.Logging

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
patrick.philipp@genmills.com - 10 Mar 2005 16:41 GMT
Hello,
We are using the Logging Application block with the Event Viewer and
SQL Server sinks.  The issue we are having is that the Application
Name shows up for the Event Log, but is marked as -null- for the SQL
Server Log.  Does anyone know how to fix this?

Thanks,
Patrick
Gary Chang[MSFT] - 11 Mar 2005 09:50 GMT
Hi Patrick

Currently I am looking for some resource to perform some research on this
issue. We will reply here with more information as soon as possible.
If you have any more concerns on it, please feel free to post here.

Thanks for your understanding!

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.
Gary Chang[MSFT] - 12 Mar 2005 09:53 GMT
Hi Patrick,

We haven't found any similar problem here, would you please give us more
information about your issue, such as the version of your VS.NET, OS, and
Windows platform?

By the way, how do you raise event to the corresponding LogEventSink?

Thanks for your understanding!

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 - 14 Mar 2005 21:13 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.