Почему файл .svclog не создается, даже если он включен в SvcConfigEditor.exe (файл App.config) для приложения windows? - PullRequest
1 голос
/ 21 апреля 2020

Я включил трассировку и ведение журнала сообщений, и поэтому файл app.config тоже, но все же указанные ниже файлы svclog не создаются по пути:

  1. app_messages.svclog
  2. app_tracelog.svclog

enter image description here

После внесения этих изменений app.config выглядит следующим образом:

```<configuration>
    <configSections>
        <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="xx.xx.MyAppLogSettings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
        </sectionGroup>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
            <section name="xx.xx.MyAppLogSettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
        </sectionGroup>
    </configSections>
    <system.diagnostics>
        <sources>
            <source propagateActivity="true" name="System.ServiceModel" switchValue="Warning,ActivityTracing">
                <listeners>
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                        <filter type="" />
                    </add>
                    <add name="ServiceModelTraceListener">
                        <filter type="" />
                    </add>
                </listeners>
            </source>
            <source name="System.ServiceModel.MessageLogging" switchValue="Warning,ActivityTracing">
                <listeners>
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                        <filter type="" />
                    </add>
                    <add name="ServiceModelMessageLoggingListener">
                        <filter type="" />
                    </add>
                </listeners>
            </source>
        </sources>
        <sharedListeners>
            <add initializeData="C:\Projects\MyAppLog\app_tracelog.svclog"
                type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
                <filter type="" />
            </add>
            <add initializeData="C:\Projects\MyAppLog\app_messages.svclog"
                type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
                <filter type="" />
            </add>
        </sharedListeners>
        <trace autoflush="false" />
    </system.diagnostics>
    <applicationSettings>
        <xx.xx.MyAppLogSettings>
            <setting name="LogLevel" serializeAs="String">
                <value>0</value>
            </setting>
        </xx.xx.MyAppLogSettings>
    </applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/></startup><userSettings>
        <xx.xx.MyAppLogSettings>
            <setting name="ErrorFile" serializeAs="String">
                <value>MyAppErrors.xml</value>
            </setting>
        </xx.xx.MyAppLogSettings>
    </userSettings>
    <system.serviceModel>
        <diagnostics performanceCounters="Default">
            <messageLogging logEntireMessage="true" logKnownPii="true" logMalformedMessages="true"
                logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
            <endToEndTracing propagateActivity="true" activityTracing="true"
                messageFlowTracing="true" />
        </diagnostics>
    </system.serviceModel>
</configuration>```

Что такое отсутствует для создания файла Tracelog (.svclog) по указанному пути?

...