21
ウェブサイトのプロジェクトへのファイルの相対を作成し、私はNugetからNlogを追加し、次のNLogの設定は使用されません:はNlogは、私は、ウェブサイトのプロジェクトを使用しています
<?xml version="1.0" encoding="utf-8" ?>
<nlog autoReload="true"
throwExceptions="true"
xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="logfile" xsi:type="File" fileName="log.txt" />
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="logfile" />
</rules>
</nlog>
私はProcessMonitorを走ったが、それはNlogを作成しようとしていることを示しています私のウェブサイトのプロジェクトフォルダの代わりにIISExpressフォルダのlog.txt。
C:\プログラムファイル(x86の)\ IIS Expressの\は
をlog.txtをどのように私はNLogではなくIISExpressフォルダの私のウェブサイトのプロジェクトのフォルダ内に、私のログファイル、log.txt
を置くことができますか?
ちなみにファイル名に
${basedir}
を追加し、これはもはや必要とすべきではありません。バージョン4.3の相対パスは '$ {basedir}'に相対的に計算されるべきです。 Tempus fugit。 –