NLog.config 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3. <targets async="true">
  4. <target name="ClientDebug" xsi:type="File"
  5. openFileCacheTimeout="10"
  6. keepFileOpen="true"
  7. archiveNumbering="Date"
  8. archiveEvery="Hour"
  9. archiveDateFormat="yyyyMMddHH"
  10. archiveFileName="${basedir}/Logs/${logger}.{#}.Debug.log"
  11. fileName="${basedir}/Logs/${logger}.${date:format=yyyyMMddHH}.Debug.log"
  12. deleteOldFileOnStartup="false"
  13. layout="${longdate} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=2} ${message}" />
  14. </targets>
  15. <targets async="true">
  16. <target name="ClientInfo" xsi:type="File"
  17. bufferSize="10240"
  18. openFileCacheTimeout="30"
  19. keepFileOpen="true"
  20. archiveNumbering="Date"
  21. archiveEvery="Hour"
  22. archiveDateFormat="yyyyMMddHH"
  23. archiveFileName="${basedir}/Logs/${logger}.{#}.Info.log"
  24. fileName="${basedir}/Logs/${logger}.${date:format=yyyyMMddHH}.Info.log"
  25. deleteOldFileOnStartup="false"
  26. layout="${longdate} ${message}" />
  27. </targets>
  28. <targets async="true">
  29. <target name="ClientWarn" xsi:type="File"
  30. bufferSize="10240"
  31. openFileCacheTimeout="30"
  32. keepFileOpen="true"
  33. archiveNumbering="Date"
  34. archiveEvery="Hour"
  35. archiveDateFormat="yyyyMMddHH"
  36. archiveFileName="${basedir}/Logs/${logger}.{#}.Warn.log"
  37. fileName="${basedir}/Logs/${logger}.${date:format=yyyyMMddHH}.Warn.log"
  38. deleteOldFileOnStartup="false"
  39. layout="${longdate} ${message}" />
  40. </targets>
  41. <targets async="true">
  42. <target name="ClientError" xsi:type="File"
  43. openFileCacheTimeout="10"
  44. keepFileOpen="true"
  45. archiveNumbering="Date"
  46. archiveEvery="Hour"
  47. archiveDateFormat="yyyyMMddHH"
  48. archiveFileName="${basedir}/Logs/${logger}.{#}.Error.log"
  49. fileName="${basedir}/Logs/${logger}.${date:format=yyyyMMddHH}.Error.log"
  50. deleteOldFileOnStartup="false"
  51. layout="${longdate} ${message}" />
  52. </targets>
  53. <targets async="true">
  54. <target name="InfoConsole" xsi:type="Console" layout="${longdata} ${message}" />
  55. </targets>
  56. <rules>
  57. <logger name="*" minlevel="Trace" maxlevel="Error" writeTo="ClientDebug" />
  58. <logger name="*" minlevel="Info" maxlevel="Info" writeTo="ClientInfo" />
  59. <logger name="*" minlevel="Warn" maxlevel="Warn" writeTo="ClientWarn" />
  60. <logger name="*" minlevel="Error" maxlevel="Error" writeTo="ClientError" />
  61. <logger name="*" minlevel="Trace" maxlevel="Error" writeTo="InfoConsole" />
  62. <logger name="*" minlevel="Info" maxlevel="Info" writeTo="InfoConsole" />
  63. <logger name="*" minlevel="Warn" maxlevel="Warn" writeTo="InfoConsole" />
  64. <logger name="*" minlevel="Error" maxlevel="Error" writeTo="InfoConsole" />
  65. </rules>
  66. </nlog>