No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

nlog.config 1.2 KiB

1234567891011121314151617181920212223242526
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. autoReload="true"
  5. internalLogLevel="Warn"
  6. internalLogFile="logs/internal-nlog.txt">
  7. <variable name="myLogLayout"
  8. value="---------------------------------------------------------------------------${newline}Date:${longdate} Level:${uppercase:${level}} User:${aspnet-user-identity}(${aspnet-request-ip}) Logger:${logger} URL:${aspnet-request-method} ${aspnet-request-url:IncludePort=true:IncludeQueryString=true} Action:${aspnet-mvc-action} ${newline}Message:${message} ${newline}${onexception:Exception:${exception:format=toString}}" />
  9. <extensions>
  10. <add assembly="NLog.Web.AspNetCore" />
  11. </extensions>
  12. <!-- define various log targets -->
  13. <targets>
  14. <!-- write logs to file -->
  15. <target name="allfile" xsi:type="File" fileName="logs/cap-all-${shortdate}.log"
  16. layout="${myLogLayout}" />
  17. </targets>
  18. <rules>
  19. <!--All logs, including from Microsoft-->
  20. <logger name="*" minlevel="Debug" writeTo="allfile" />
  21. </rules>
  22. </nlog>