Web service logging issue

Discussion in 'ASP .Net Web Services' started by william, Jan 16, 2008.

  1. william

    william Guest

    Hi,

    I use enterprise library 3.0 logging block in a web service project. I used
    configuration tool to config web.config file(added logging section) for my
    web service. I deployed it as web site on windows 2003. When I test it, the
    logging seems not working. I guess I missed something, could anyone help me
    out?
    Here is the logging section in the web.config file:
    <configSections>
    <section name="loggingConfiguration"
    type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings,
    Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    <section name="dataConfiguration"
    type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
    Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" />
    </configSections>
    <loggingConfiguration name="Logging Application Block" tracingEnabled="true"
    defaultCategory="General" logWarningsWhenNoCategoriesMatch="false">
    <listeners>
    <add source="FIS Web Service" formatter="Text Formatter"
    log="Application" machineName=""
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData,
    Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    traceOutputOptions="None"
    type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener,
    Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    name="Formatted EventLog TraceListener" />
    </listeners>
    <formatters>
    <add template="Timestamp: {timestamp
    Message: {message
    Category:
    {category
    Priority: {priority
    EventId: {eventid
    Severity:
    {severity
    Title:{title
    Machine: {machine
    Application Domain:
    {appDomain
    Process Id: {processId
    Process Name: {processName
    Win32 Thread
    Id: {win32ThreadId
    Thread Name: {threadName
    Extended Properties:
    {dictionary({key} - {value
    )}"

    type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter,
    Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    name="Text Formatter" />
    </formatters>
    <logFilters>
    <add minimumPriority="1" maximumPriority="2147483647"
    type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter,
    Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    name="Priority Filter" />
    </logFilters>
    <categorySources>
    <add switchValue="All" name="General">
    <listeners>
    <add name="Formatted EventLog TraceListener" />
    </listeners>
    </add>
    <add switchValue="All" name="WebService">
    <listeners>
    <add name="Formatted EventLog TraceListener" />
    </listeners>
    </add>
    </categorySources>
    <specialSources>
    <allEvents switchValue="All" name="All Events">
    <listeners>
    <add name="Formatted EventLog TraceListener" />
    </listeners>
    </allEvents>
    <notProcessed switchValue="All" name="Unprocessed Category" />
    <errors switchValue="All" name="Logging Errors & Warnings">
    <listeners>
    <add name="Formatted EventLog TraceListener" />
    </listeners>
    </errors>
    </specialSources>
    </loggingConfiguration>

    Besides, I put logging code in an utility assembly where I call enterprise
    library, and I reference this assembly (strong named, it's been tested) from
    my web service.

    Thanks in advance.

    william
     
    william, Jan 16, 2008
    #1
    1. Advertisements

  2. "william" <> wrote in message
    news:...
    > Hi,
    >
    > I use enterprise library 3.0 logging block in a web service project. I
    > used
    > configuration tool to config web.config file(added logging section) for my
    > web service. I deployed it as web site on windows 2003. When I test it,
    > the
    > logging seems not working. I guess I missed something, could anyone help
    > me
    > out?
    > Here is the logging section in the web.config file:
    > <configSections>
    > <section name="loggingConfiguration"
    > type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings,
    > Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    > <section name="dataConfiguration"
    > type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings,
    > Microsoft.Practices.EnterpriseLibrary.Data, Version=3.1.0.0,
    > Culture=neutral,
    > PublicKeyToken=b03f5f7f11d50a3a" />
    > </configSections>
    > <loggingConfiguration name="Logging Application Block"
    > tracingEnabled="true"
    > defaultCategory="General" logWarningsWhenNoCategoriesMatch="false">
    > <listeners>
    > <add source="FIS Web Service" formatter="Text Formatter"
    > log="Application" machineName=""
    > listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData,
    > Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    > traceOutputOptions="None"
    > type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener,
    > Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    > name="Formatted EventLog TraceListener" />
    > </listeners>
    > <formatters>
    > <add template="Timestamp: {timestamp}
    > Message: {message}
    > Category:
    > {category}
    > Priority: {priority}
    > EventId: {eventid}
    > Severity:
    > {severity}
    > Title:{title}
    > Machine: {machine}
    > Application Domain:
    > {appDomain}
    > Process Id: {processId}
    > Process Name: {processName}
    > Win32 Thread
    > Id: {win32ThreadId}
    > Thread Name: {threadName}
    > Extended Properties:
    > {dictionary({key} - {value}
    > )}"
    >
    > type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter,
    > Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    > name="Text Formatter" />
    > </formatters>
    > <logFilters>
    > <add minimumPriority="1" maximumPriority="2147483647"
    > type="Microsoft.Practices.EnterpriseLibrary.Logging.Filters.PriorityFilter,
    > Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0,
    > Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
    > name="Priority Filter" />
    > </logFilters>
    > <categorySources>
    > <add switchValue="All" name="General">
    > <listeners>
    > <add name="Formatted EventLog TraceListener" />
    > </listeners>
    > </add>
    > <add switchValue="All" name="WebService">
    > <listeners>
    > <add name="Formatted EventLog TraceListener" />
    > </listeners>
    > </add>
    > </categorySources>
    > <specialSources>
    > <allEvents switchValue="All" name="All Events">
    > <listeners>
    > <add name="Formatted EventLog TraceListener" />
    > </listeners>
    > </allEvents>
    > <notProcessed switchValue="All" name="Unprocessed Category" />
    > <errors switchValue="All" name="Logging Errors & Warnings">
    > <listeners>
    > <add name="Formatted EventLog TraceListener" />
    > </listeners>
    > </errors>
    > </specialSources>
    > </loggingConfiguration>
    >
    > Besides, I put logging code in an utility assembly where I call enterprise
    > library, and I reference this assembly (strong named, it's been tested)
    > from
    > my web service.


    Does it work on your development machine? If so, what event source does it
    write to in the event log? Does that event source already exist on the
    server? If not, then you'll have to create it before your web service is
    used for the first time, as a web service doesn't run with the privileges
    necessary to create an event log source.
    --
    --------------------------------------------------------------------------------
    John Saunders | MVP - Windows Server System - Connected System Developer
     
    John Saunders [MVP], Jan 20, 2008
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hocho888
    Replies:
    1
    Views:
    881
  2. Michael Averstegge
    Replies:
    0
    Views:
    4,563
    Michael Averstegge
    Jan 10, 2006
  3. Not Me
    Replies:
    1
    Views:
    3,476
    Not Me
    Jun 5, 2007
  4. Isaias Formacio Serna

    Web Service that calls an external Web Service

    Isaias Formacio Serna, Jan 28, 2004, in forum: ASP .Net Security
    Replies:
    5
    Views:
    469
  5. Replies:
    1
    Views:
    413
    Joe Kaplan \(MVP - ADSI\)
    Jun 14, 2006
  6. dgleeson422111

    Consuming local web service - ok, remote web service -problem?

    dgleeson422111, Jan 26, 2010, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    1,093
    dgleeson422111
    Jan 26, 2010
  7. JC

    Calling a web service from a web service

    JC, Aug 16, 2003, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    261
    Tom Vande Stouwe MCSD.net
    Aug 20, 2003
  8. Leo Violette
    Replies:
    0
    Views:
    1,316
    Leo Violette
    Apr 17, 2009
Loading...