Nlog no crea un archivo relativo al proyecto del sitio web
Estoy usando un proyecto de sitio web, agregué Nlog desde Nuget, y usé la siguiente configuración de 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>
Ejecuté ProcessMonitor y muestra que Nlog está tratando de crear un registro.txt en la carpeta IISExpress en lugar de la carpeta de mi proyecto de sitio web.
C:\Program Files (x86)\IIS Express\log.txt
¿Cómo puedo hacer que NLog ponga mi archivo de registro, log.txt
, en la carpeta de mi proyecto de sitio web en lugar de la carpeta IISExpress?
25
1 answers
Lo averiguamos.
Añadir ${basedir}
al nombre del archivo
filename="${basedir}/log.txt"
45
Author: guanome,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-05-16 15:02:49
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2012-05-16 15:02:49