32位操作系统上的示例文件目标路径为c:\ temp \ 32 \和64位c:\ temp \ 64
答案 0 :(得分:1)
您可以在filenname中使用布局渲染器。
您可以使用:
Environment layout renderer PROCESSOR_ARCHITECTURE
变量是AMD64或X86(或IA64,见superuser):
用法:${environment:PROCESSOR_ARCHITECTURE}
示例:
<target
xsi:type="File"
name="file1"
fileName="c:\temp\${when:when='${environment:PROCESSOR_ARCHITECTURE}'='X86':inner=32:else=64}\file.log" />
或者,根据您的条件使用When layout renderer。
示例,两个目标:
<target
xsi:type="File"
name="file_32"
fileName="c:\temp\32\file.log" />
<target
xsi:type="File"
name="file_64"
fileName="c:\temp\64\file.log" />
和两条规则:
<rules>
<logger name="*" writeTo="file_32">
<filters>
<when condition="'${environment:PROCESSOR_ARCHITECTURE}'!='X86'" action="Ignore" />
</filters>
</logger>
<logger name="*" writeTo="file_64">
<filters>
<when condition="'${environment:PROCESSOR_ARCHITECTURE}'='X86'" action="Ignore" />
</filters>
</logger>
</rules>