NLog configuration file issues.
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
internalLogFile="c:\temp\internal-nlog-AspNetCore.txt">
<extensions>
<add assembly="NLog.Web.AspNetCore" />
</extensions>
<targets>
<target xsi:type="File" name="auditlog" filename="{basedir}\Logs\Main\${shortdate}.txt" layout="[ApiAuditLog] | Logger: ${logger} | ${time} | Details: ${message}" />
<target xsi:type="File" name="servicelog" filename="{basedir}\Logs\Main\${shortdate}.txt" layout="[ServiceLog] | Logger: ${logger} | ${time} | Details: ${message}" />
<target xsi:type="File" name="exceptionfile" filename="{basedir}\Logs\Exceptions\${shortdate}.txt" layout="[ExceptionLog] | Logger: ${logger} | ${time} | Details: ${message}"/>/>
</targets>
<rules>
<logger name="Microsoft.*" maxLevel="info" final="true" />
<logger name="GameStore.API.Middlewares.RequestResponseLoggingMiddleware*" minlevel="Info" writeTo="auditlog" final="true"/>
<logger name="GameStore.BLL.Services*" minlevel="Info" writeTo="servicelog" final="true"/>
<logger name="*ExceptionHandlingMiddleware*" minlevel="Error" writeto="exceptionfile" />
</rules>
</nlog>
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
internalLogFile="c:\temp\internal-nlog-AspNetCore.txt">
<extensions>
<add assembly="NLog.Web.AspNetCore" />
</extensions>
<targets>
<target xsi:type="File" name="auditlog" filename="{basedir}\Logs\Main\${shortdate}.txt" layout="[ApiAuditLog] | Logger: ${logger} | ${time} | Details: ${message}" />
<target xsi:type="File" name="servicelog" filename="{basedir}\Logs\Main\${shortdate}.txt" layout="[ServiceLog] | Logger: ${logger} | ${time} | Details: ${message}" />
<target xsi:type="File" name="exceptionfile" filename="{basedir}\Logs\Exceptions\${shortdate}.txt" layout="[ExceptionLog] | Logger: ${logger} | ${time} | Details: ${message}"/>/>
</targets>
<rules>
<logger name="Microsoft.*" maxLevel="info" final="true" />
<logger name="GameStore.API.Middlewares.RequestResponseLoggingMiddleware*" minlevel="Info" writeTo="auditlog" final="true"/>
<logger name="GameStore.BLL.Services*" minlevel="Info" writeTo="servicelog" final="true"/>
<logger name="*ExceptionHandlingMiddleware*" minlevel="Error" writeto="exceptionfile" />
</rules>
</nlog>
0 Replies