2014-02-06 7 views
0

ASP.Net MVC 5 응용 프로그램이 있는데 Ent Lib 6 로깅 응용 프로그램 블록을 사용합니다.엔터프라이즈 라이브러리 로깅 블록 - 파일 및 FTP 잠그지 않음이 파일을 다운로드하지 못합니다.

세부 사항 :

  • 내 웹 사이트는 공유 호스팅 서버에서 호스팅됩니다.
  • 우리는 Filezilla (FTP 클라이언트)를 사용하여 파일/로그를 게시하고 다운로드합니다.
  • 로그 파일이 서버에 생성됩니다

문제 : 다운로드하려고하면

로그 파일이 중이기 때문에 프로세스가 파일을 액세스 할 수 없습니다 내가 "550라는 오류가 FTP를 사용하여 서버를 형성 다른 프로세스에서 사용했습니다. "

enter image description here

이 내 Web.config의이 모습입니다

내가 파일 잠금 해제 (서버) 내의 Web.config를 변경하는 경우 예상대로
<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <configSections>  
    <section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" /> 
    </configSections> 
    <appSettings> 
    ..... 
    </appSettings> 
    <loggingConfiguration name="" tracingEnabled="true" defaultCategory="General"> 
    <listeners> 
     <add name="Rolling Flat File Trace Listener" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.RollingFlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
      listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.RollingFlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
      fileName="C:\ServerPath\Log\Log.txt" footer="" formatter="Text Formatter" header="" 
      rollFileExistsBehavior="Increment" rollInterval="Day" timeStampPattern="dd-MM-yyyy" 
      asynchronous="false" /> 
    </listeners> 
    <formatters> 
     <add type="Microsoft.Practices.EnterpriseLibrary.Logging.Formatters.TextFormatter, Microsoft.Practices.EnterpriseLibrary.Logging, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
      template="{timestamp(local:M/dd/yyyy HH:mm:ss.fff)} ({win32ThreadId}) ({severity}) {message}" name="Text Formatter" /> 
    </formatters> 
    <categorySources> 
     <add switchValue="All" name="General"> 
     <listeners> 
      <add name="Rolling Flat 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 &amp; Warnings"> 
     <listeners> 
      <add name="Rolling Flat File Trace Listener" /> 
     </listeners> 
     </errors> 
    </specialSources> 
    </loggingConfiguration> 
    ..... 
</configuration> 

다음 나는 나 나는 경우를 다운로드 할 수 있습니다 충분히 길게 기다린 다음 잠금 장치도 해제됩니다. 그러나 물론 이것만으로는 충분하지 않습니다. 서버에서 로그를 실시간으로 가져올 수 있습니까? 다른 옵션은 다른 로깅 라이브러리를 사용할 수 있습니다.

답변

0

이 질문에 비틀 거린 경우, 이것은 내가 관찰 한 것입니다.

며칠 동안 고생하고 나서 브라우저를 통해 로그 파일을 노출 할 수있는 두 번째 URL이 없으면이 문제를 해결하기위한 쉽고 간단한 방법이 없다는 결론을 내 렸습니다. 이는 잘 작동하지만 URL을 가진 사람은 누구나 로그 내용을 볼 수 있으므로 보안 위험이 있습니다.

다른 해결책은 서버에 대한 원격 액세스를 제공하도록 서비스 제공 업체에 요청하는 것입니다. 이는보다 안전한 접근 방법입니다.