1

ウェブロールから文字列と紺色のDB接続文字列を取得し、DBにログを書き込もうとします。 これは問題なく動作します。ログのdevのコンピュータからの作品ではなく、私はすべてのデプロイメント接続を使用して自分のコンピュータから完全に統合テストを実行しています、エンタープライズライブラリ5. を使用して、私のログリポジトリとしてSQL Azureのを使用しています

しかしacctuallyステージングenviormentに展開し、ログへの書き込みしようとすると、例外がスローされないが、何のログはどちらか書かれていません。

<?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" /> 
    <section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="false" /> 
    </configSections> 
    <loggingConfiguration name="" tracingEnabled="true" defaultCategory="MainLogger" 
     revertImpersonation="false"> 
    <listeners> 
     <add name="LoggingDb" type="Microsoft.Practices.EnterpriseLibrary.Logging.Database.FormattedDatabaseTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
      listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Database.Configuration.FormattedDatabaseTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging.Database, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
      databaseInstanceName="LoggingDb" writeLogStoredProcName="WriteLog" 
      addCategoryStoredProcName="AddCategory" traceOutputOptions="DateTime, Timestamp, ProcessId, ThreadId, Callstack" /> 
    </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="MainLogger"> 
     <listeners> 
      <add name="LoggingDb" /> 
     </listeners> 
     </add> 
    </categorySources> 
    <specialSources> 
     <allEvents switchValue="All" name="All Events"> 
     <listeners> 
      <add name="LoggingDb" /> 
     </listeners> 
     </allEvents> 
     <notProcessed switchValue="All" name="Unprocessed Category"> 
     <listeners> 
      <add name="LoggingDb" /> 
     </listeners> 
     </notProcessed> 
     <errors switchValue="All" name="Logging Errors &amp; Warnings"> 
     <listeners> 
      <add name="LoggingDb" /> 
     </listeners> 
     </errors> 
    </specialSources> 
    </loggingConfiguration> 
    <dataConfiguration defaultDatabase="LoggingDb" /> 
    <connectionStrings> 
    <add name="LoggingDb" connectionString="Server=tcp:********.database.windows.net,1433;Database=****.Logging;User ID=*******@*******;Password=**********;Trusted_Connection=False;Encrypt=True;" providerName="System.Data.SqlClient" /> 
    </connectionStrings> 
</configuration> 

そして、私は次の例外受け取る:構成で

無効TraceListenerDataタイプ「をlistenerDataType = "Microsoft.Practices.EnterpriseLibrary.Logging.Databaseここ

は私のapp.config関連するセクションです。 Configuration.FormattedDatabaseTraceListenerData、Microsoft.Practices.EnterpriseLibrary.Logging.Database、バージョン= 5.0.414.0、カルチャニュートラル、PublicKeyToken = = 31bf3856ad364e35" 」。 (E:¥sitesroot¥0¥web.config 30行目)

Devで動作している間に... このアイデアや経験は何ですか?

よろしく、

ジェームズ

+2

Microsoft.Practices.EnterpriseLibrary.Logging.Database.dllがステージングに展開されていることを確認します。それがそのエラーの典型的な原因です。 –

答えて

1

はい、コメントとして、次のようにして、順番に動作するログブロックのためのあなたのサービスディレクトリにある必要がありますDLLです:あなたは確認することができます

Microsoft.Practices.Unity.dll 
Microsoft.Practices.ServiceLocation.dll 
Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll 
Microsoft.Practices.EnterpriseLibrary.Logging.dll 
Microsoft.Practices.EnterpriseLibrary.Common.dll 
+0

この回答が元の質問を解決する場合は、それを受け入れる必要があります。 –

関連する問題