2012-04-13 23 views
0

Windowsのイベント・ビューアーにログを表示するようにアプリケーションを構成しようとしましたが、プログラムはうまく動作しません。私の設定が正しいかどうか誰にでも教えてもらえますか?それともエラーがありますか?アプリケーション・ライブラリーのログがWindowsイベント・ビューアーに表示されない

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <configSections> 
     <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" /> 
    </configSections> 
    <loggingConfiguration name="" tracingEnabled="true" defaultCategory="General"> 
     <listeners> 
      <add name="Event Log Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FormattedEventLogTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
       listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FormattedEventLogTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
       source="Enterprise Library Logging" formatter="Text Formatter" 
       log="" machineName="." traceOutputOptions="None" /> 
     </listeners> 
     <formatters> 
      <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
       template="Timestamp: {timestamp}{newline}&#xA;Message: {message}{newline}&#xA;Category: {category}{newline}&#xA;Priority: {priority}{newline}&#xA;EventId: {eventid}{newline}&#xA;Severity: {severity}{newline}&#xA;Title:{title}{newline}&#xA;Machine: {localMachine}{newline}&#xA;App Domain: {localAppDomain}{newline}&#xA;ProcessId: {localProcessId}{newline}&#xA;Process Name: {localProcessName}{newline}&#xA;Thread Name: {threadName}{newline}&#xA;Win32 ThreadId:{win32ThreadId}{newline}&#xA;Extended Properties: {dictionary({key} - {value}{newline})}" 
       name="Text Formatter" /> 
     </formatters> 
     <categorySources> 
      <add switchValue="All" name="General"> 
       <listeners> 
        <add name="Event Log Listener" /> 
       </listeners> 
      </add> 
     </categorySources> 
     <specialSources> 
      <allEvents switchValue="All" name="All Events" /> 
      <notProcessed switchValue="All" name="Unprocessed Category" /> 
      <errors switchValue="All" name="Logging Errors &amp; Warnings"> 
       <listeners> 
        <add name="Event Log Listener" /> 
       </listeners> 
      </errors> 
     </specialSources> 
    </loggingConfiguration> 
    <system.diagnostics> 
     <sources> 
      <!-- This section defines the logging configuration for My.Application.Log --> 
      <source name="DefaultSource" switchName="DefaultSwitch"> 
       <listeners> 
        <add name="FileLog"/> 
        <!-- Uncomment the below section to write to the Application Event Log --> 
        <!--<add name="EventLog"/>--> 
       </listeners> 
      </source> 
     </sources> 
     <switches> 
      <add name="DefaultSwitch" value="Information" /> 
     </switches> 
     <sharedListeners> 
      <add name="FileLog" 
       type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" 
       initializeData="FileLogWriter"/> 
      <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log --> 
      <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> --> 
     </sharedListeners> 
    </system.diagnostics> 
</configuration> 
+0

イベントビューアへの書き込み権限がない可能性があります。見てみな。 – Aristos

+0

このパーミッションを確認するにはどうすればよいですか?多分私はadministradorとしてアプリケーションを実行する場合??? – Jorge

+1

問題が解決しました...私は管理者としてアプリケーションを実行する必要があります...しかし、どのように私はこのアプリケーションを正常に実行するように設定できますか? – Jorge

答えて

0

レジストリを開くと、イベントビューアーのキーが表示されます。

は、右クリックして、あなたがasp.netプールからの書き込み権限を取得するために獲得した部分に権限を参照してくださいHKLM/SYSTEM/CurrentControlSet/Services/EventLog

です。

関連する問題