Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6339823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:43:15+00:00 2026-05-24T19:43:15+00:00

I am attempting to enable WCF message tracing for a single service (one of

  • 0

I am attempting to enable WCF message tracing for a single service (one of several included in this IIS application). I have created a web.config file that is placed in the same physical directory as my .svc file. I am able to configure the service from this web.config file, modifying behaviors, endpoints etc. However, when I attempt to include the include a system.diagnostics node, it appears to have no effect. This does not produce a trace file:

<?xml version="1.0"?>
<configuration>
    <system.serviceModel>    
        <services>
            <service name="My.Awesome.Wcf.Service" />
            <!-- my endpoints and behaviors are defined programmatically -->
        </services>

        <diagnostics>
            <messageLogging
                 logEntireMessage="true"
                 logMalformedMessages="true"
                 logMessagesAtServiceLevel="true"
                 logMessagesAtTransportLevel="true"
                 maxMessagesToLog="3000" />
        </diagnostics>
    </system.serviceModel>

    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true" >
                <listeners>
                    <add name="xml"/>
                </listeners>
            </source>
            <source name="System.ServiceModel.MessageLogging">
                <listeners>
                    <add name="xml"/>
                </listeners>
            </source>
        </sources>
        <sharedListeners>
            <add name="xml"
                 type="System.Diagnostics.XmlWriterTraceListener"
                       initializeData="C:\logs\Traces.svclog" />
        </sharedListeners>
        <trace autoflush="true" />
    </system.diagnostics>
</configuration>

If I move the entire system.diagnostics node out of this sub-directory web.config to the application’s root web.config, then it magically starts working. As far as I can tell, the system.diagnostics section is not limited to the application’s root web.config, since my machine.config shows this section definition:

<section name="system.diagnostics" type="System.Diagnostics.SystemDiagnosticsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>

Note that this definition does not include an “allowDefinition” attribute, which, according to this MSDN documentation for the section element means that it can be defined “Everywhere” which should include physical subdirectories. I have not been able to find any system.diagnostics definitions in any parent web.configs either.

Does anyone know why this system.diagnostics configuration might not be getting processed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:43:17+00:00Added an answer on May 24, 2026 at 7:43 pm

    To close out this question: the real question is why would you want to specify WCF logging at a sub-folder level?

    WCF hosting is at the IIS Application level. You can’t have WCF logging disabled for services at the root URL then enabled at lower levels. If you want to emulate such scenario, then you need 2 WCF applications, one within the other (in IIS); in .NET, they are 2 separate AppDomains.

    If you prefer to stick to one AppDomain, then you can perhaps achieve what you are trying to accomplish to by creating message filters. See “Message Filters” in msdn.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been attempting to compile/run a sample WCF application from Juval Lowy's website
I'v been attempting to configure my WCF service to expose both SOAP and Json
I'm attempting to implement this paper . I've have most of it down, but
I'm running Windows 7 64-bit. I'm attempting to host a WCF service which will
I am simply attempting to use a checkbox to enable/disable an NSTextField. I have
I created a number of standard WCF Services (Service Contract and Host (svc) are
I'm attempting several methods trying to enable/disable Wi-Fi (toggle). Here are some things I
I am attempting to enable remember me functionality using spring security <bean id=userService class=mypath.service.UserDetailsServiceImpl
Attempting to use the data series from this example no longer passes the JSONLint
I have tried every combination to allow unauthenticated access to WCF as in Local

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.