2010-04-23 6 views

답변

6

당신은 당신의 로그 파일 경로에 환경 변수를 사용할 수 있어야합니다 :

제가 이야기 폴더는 호출하여 얻을 것입니다. 나는 Environment.SpecialFolder.ApplicationData%APPDATA%과 같다고 믿습니다.

그래서 당신은에 파일 이름을 설정할 수 있습니다 % APPDATA % \에서는 MyApplication \ 로그 \의 trace.log 명시 적으로 폴더를 생성 할 필요가 없습니다 디렉토리 구조는 런타임에 생성됩니다 . :-) 완벽하게 작동 당신은 바로 그 자리에서 못을 명중,

<add fileName="%APPDATA%\MyApplication\Logs\trace.log" header="" 
    footer="" formatter="Text Formatter"  
    listenerDataType="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.FlatFileTraceListenerData, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" 
    traceOutputOptions="None" filter="All" type="Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners.FlatFileTraceListener, Microsoft.Practices.EnterpriseLibrary.Logging, Version=4.1.0.0, Culture=neutral, PublicKeyToken=null" 
    name="Flat File Destination" /> 
+0

들으 M8 ... –

+0

매력처럼 일 :

구성 파일은 같을 것입니다. 고마워요! 정말 필요하고 그것을 얻었다! – Venkat

관련 문제