Enterprise Library 5.0 로깅을 사용할 때 엉뚱한 로깅이 발생합니다.Microsoft Enterprise Library 5.0 로깅 처음 몇 WCF 메서드 호출시에만 발생합니다.
로드 균형 조정 된 구성으로 Windows 2008 R2 서버에서 실행되는 IIS (7.5)에서 호스트되는 WCF 4.0 응용 프로그램과 관련된 문제입니다. Dependency Injection을 위해 Unity (2.0)를 사용하고 있습니다. 롤링 텍스트 파일에 기록하도록 라이브러리를 구성했습니다. 응용 프로그램은 AppFabricCache를 사용합니다.
로깅은 서비스를 호스팅하는 웹 응용 프로그램을 다시 시작한 후 처음 몇 번의 호출에서 성공한 것으로 보입니다. 그 이후에는 더 이상 기록되지 않습니다. 구성에서 오류가 발생했거나 텍스트 파일에 쓰기/플러시 출력에 약간의 경합이있을 수 있습니다. 로깅 클래스는 스레드로부터 안전하게 작동한다는 것을 알고 있습니다.
다음은 구성 파일의 관련 부분입니다. 모든 의견을 감사드립니다. 감사. 당신이해야
<loggingConfiguration name="loggingConfiguration" tracingEnabled="true" defaultCategory="General">
<listeners>
<add name="Rolling File Trace Listener"
type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
fileName="d:\SOMEPATH\Logs\trace.log"
formatter="Text Formatter"
header="" footer=""
timeStampPattern="yyyy-MM-dd hh:mm:ss.fff"
traceOutputOptions="None"
maxArchivedFiles="2000"
rollFileExistsBehavior="Increment" rollInterval="Day" rollSizeKB="1024" />
</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(yyyyMMdd HH:mm:ss.fff)} - {message}"
name="Text Formatter" />
</formatters>
<categorySources>
<add switchValue="All" name="General">
<listeners>
<add name="Rolling File Trace Listener" />
</listeners>
</add>
</categorySources>
<specialSources>
<allEvents switchValue="All" name="All Events" />
<notProcessed switchValue="All" name="Unprocessed Category" />
<errors switchValue="All" name="Logging Errors & Warnings">
<listeners>
<add name="Rolling File Trace Listener" />
</listeners>
</errors>
</specialSources>
</loggingConfiguration>
감사합니다. 당신이 올바른지. 롤오버 사용 권한 문제가 있습니다. 나는 당신의 제안에 따라 플랫 파일에 오류를 쓰도록 설정 파일을 조정했다. 모든 도메인 사용자에게 로깅 폴더에 대한 모든 권한을 부여하더라도 문제가 있습니다. 문제를 일으키는 파일 잠금 문제가 있는지 궁금합니다. 아래 오류 : at (FileIOPermissionAccess 액세스, AccessControlActions 컨트롤, String [] pathListOrig, 부울 checkForDuplicates, 부울 needFullPath, 부울 copyPathList) System.Security.Permissions.FileIOPermission..ctor에서 –