NLog.config 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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="ServerDebug" xsi:type="File"
  5. openFileCacheTimeout="10"
  6. keepFileOpen="true"
  7. archiveNumbering="Date"
  8. archiveEvery="Hour"
  9. archiveDateFormat="yyyyMMddHH"
  10. archiveFileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.{#}.Debug.log"
  11. fileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.${date:format=yyyyMMddHH}.Debug.log"
  12. deleteOldFileOnStartup="false"
  13. layout="${longdate} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=3} ${message}" />
  14. </targets>
  15. <targets async="true">
  16. <target name="ServerInfo" 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}.${var:appIdFormat}.{#}.Info.log"
  24. fileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.${date:format=yyyyMMddHH}.Info.log"
  25. deleteOldFileOnStartup="false"
  26. layout="${longdate} ${message}" />
  27. </targets>
  28. <targets async="true">
  29. <target name="ServerWarn" 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}.${var:appIdFormat}.{#}.Warn.log"
  37. fileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.${date:format=yyyyMMddHH}.Warn.log"
  38. deleteOldFileOnStartup="false"
  39. layout="${longdate} ${message}" />
  40. </targets>
  41. <targets async="true">
  42. <target name="ServerError" xsi:type="File"
  43. openFileCacheTimeout="10"
  44. keepFileOpen="true"
  45. archiveNumbering="Date"
  46. archiveEvery="Hour"
  47. archiveDateFormat="yyyyMMddHH"
  48. archiveFileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.{#}.Error.log"
  49. fileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.${date:format=yyyyMMddHH}.Error.log"
  50. deleteOldFileOnStartup="false"
  51. layout="${longdate} ${message}" />
  52. </targets>
  53. <targets async="true">
  54. <target name="ServerConsole" xsi:type="Console"
  55. layout="${longdate} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=3} ${message}" />
  56. </targets>
  57. <targets async="true">
  58. <target name="Watcher" xsi:type="File"
  59. openFileCacheTimeout="10"
  60. keepFileOpen="true"
  61. fileName="${basedir}/../Logs/${logger}.${var:appIdFormat}.Debug.log"
  62. deleteOldFileOnStartup="false"
  63. layout="${longdate} ${callsite:className=false:methodName=false:fileName=true:includeSourcePath=false:skipFrames=3} ${message}" />
  64. </targets>
  65. <targets async="true">
  66. <target name="RobotConsole" xsi:type="Console" layout="${message}" />
  67. </targets>
  68. <rules>
  69. <logger ruleName="ServerDebug" name="Server" minlevel="Trace" maxlevel="Error" writeTo="ServerDebug" />
  70. <logger ruleName="ServerInfo" name="Server" minlevel="Info" maxlevel="Info" writeTo="ServerInfo" />
  71. <logger ruleName="ServerWarn" name="Server" minlevel="Warn" maxlevel="Warn" writeTo="ServerWarn" />
  72. <logger ruleName="ServerError" name="Server" minlevel="Error" maxlevel="Error" writeTo="ServerError" />
  73. <logger ruleName="ServerConsole" name="Server" minlevel="Trace" maxlevel="Error" writeTo="ServerConsole" />
  74. <logger ruleName="Watcher" name="Watcher" minlevel="Trace" maxlevel="Error" writeTo="Watcher" />
  75. </rules>
  76. </nlog>