You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
6.1 KiB

8 months ago
  1. using NLog.Targets;
  2. namespace Mirle.Component.Record
  3. {
  4. /// <summary>
  5. /// 記錄檔格式類別
  6. /// </summary>
  7. public static class FileLayout
  8. {
  9. /// <summary>
  10. /// 微服物平台主程式記錄檔格式
  11. /// </summary>
  12. public static readonly FileTarget MicroServicePlatformFileLayout = new FileTarget()
  13. {
  14. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  15. FileName = "${basedir}/Logs/${shortdate}/MicroServicePlatform.log",
  16. ArchiveFileName = "${basedir}/archives/${shortdate}/MicroServicePlatform.zip",
  17. ArchiveNumbering = ArchiveNumberingMode.Date,
  18. ArchiveDateFormat = "yyyy-MM-dd",
  19. ArchiveEvery = FileArchivePeriod.Day,
  20. EnableArchiveFileCompression = true,
  21. KeepFileOpen = true,
  22. MaxArchiveFiles = 7
  23. };
  24. /// <summary>
  25. /// 倉儲執行系統主程式記錄檔格式
  26. /// </summary>
  27. public static readonly FileTarget WarehouseExecutionSystemFileLayout = new FileTarget()
  28. {
  29. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  30. FileName = "${basedir}/Logs/${shortdate}/WarehouseExecutionSystem.log",
  31. ArchiveFileName = "${basedir}/archives/${shortdate}/WarehouseExecutionSystem.zip",
  32. ArchiveNumbering = ArchiveNumberingMode.Date,
  33. ArchiveDateFormat = "yyyy-MM-dd",
  34. ArchiveEvery = FileArchivePeriod.Day,
  35. EnableArchiveFileCompression = true,
  36. KeepFileOpen = true,
  37. MaxArchiveFiles = 7
  38. };
  39. /// <summary>
  40. /// 倉儲控制系統主程式記錄檔格式
  41. /// </summary>
  42. public static readonly FileTarget WarehouseControlSystemFileLayout = new FileTarget()
  43. {
  44. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  45. FileName = "${basedir}/Logs/${shortdate}/WarehouseControlSystem.log",
  46. ArchiveFileName = "${basedir}/archives/${shortdate}/WarehouseControlSystem.zip",
  47. ArchiveNumbering = ArchiveNumberingMode.Date,
  48. ArchiveDateFormat = "yyyy-MM-dd",
  49. ArchiveEvery = FileArchivePeriod.Day,
  50. EnableArchiveFileCompression = true,
  51. KeepFileOpen = true,
  52. MaxArchiveFiles = 7
  53. };
  54. /// <summary>
  55. /// 控制器控制系統主程式記錄檔格式
  56. /// </summary>
  57. public static readonly FileTarget PLCControlerSystemFileLayout = new FileTarget()
  58. {
  59. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  60. FileName = "${basedir}/Logs/${shortdate}/PLCControlerSystem.log",
  61. ArchiveFileName = "${basedir}/archives/${shortdate}/PLCControlerSystem.zip",
  62. ArchiveNumbering = ArchiveNumberingMode.Date,
  63. ArchiveDateFormat = "yyyy-MM-dd",
  64. ArchiveEvery = FileArchivePeriod.Day,
  65. EnableArchiveFileCompression = true,
  66. KeepFileOpen = true,
  67. MaxArchiveFiles = 7
  68. };
  69. /// <summary>
  70. /// 資料交換平台主程式記錄檔格式
  71. /// </summary>
  72. public static readonly FileTarget DataExchangePlatformFileLayout = new FileTarget()
  73. {
  74. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  75. FileName = "${basedir}/Logs/${shortdate}/DataExchangePlatform.log",
  76. ArchiveFileName = "${basedir}/archives/${shortdate}/DataExchangePlatform.zip",
  77. ArchiveNumbering = ArchiveNumberingMode.Date,
  78. ArchiveDateFormat = "yyyy-MM-dd",
  79. ArchiveEvery = FileArchivePeriod.Day,
  80. EnableArchiveFileCompression = true,
  81. KeepFileOpen = true,
  82. MaxArchiveFiles = 7
  83. };
  84. /// <summary>
  85. /// 資料交換平台主程式記錄檔格式
  86. /// </summary>
  87. public static readonly FileTarget WCSProcessFlowFileLayout = new FileTarget()
  88. {
  89. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  90. FileName = "${basedir}/Logs/${shortdate}/Flow.log",
  91. ArchiveFileName = "${basedir}/archives/${shortdate}/Flow.zip",
  92. ArchiveNumbering = ArchiveNumberingMode.Date,
  93. ArchiveDateFormat = "yyyy-MM-dd",
  94. ArchiveEvery = FileArchivePeriod.Day,
  95. EnableArchiveFileCompression = true,
  96. KeepFileOpen = true,
  97. MaxArchiveFiles = 7
  98. };
  99. /// <summary>
  100. /// 錯誤資料紀錄檔格式
  101. /// </summary>
  102. public static readonly FileTarget ErrorDataFileLayout = new FileTarget()
  103. {
  104. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  105. FileName = "${basedir}/Logs/${shortdate}/ErrorData.log",
  106. ArchiveFileName = "${basedir}/archives/${shortdate}/ErrorData.zip",
  107. ArchiveNumbering = ArchiveNumberingMode.Date,
  108. ArchiveDateFormat = "yyyy-MM-dd",
  109. ArchiveEvery = FileArchivePeriod.Day,
  110. EnableArchiveFileCompression = true,
  111. KeepFileOpen = true,
  112. MaxArchiveFiles = 7
  113. };
  114. /// <summary>
  115. /// 戰情室紀錄檔格式
  116. /// </summary>
  117. public static readonly FileTarget WarRoomFileLayout = new FileTarget()
  118. {
  119. Layout = "[${longdate}] | [${logger}] | [${level:uppercase=true}] | ${message}${exception:format=tostring}",
  120. FileName = "${basedir}/Logs/${shortdate}/WarRoom.log",
  121. ArchiveFileName = "${basedir}/archives/${shortdate}/WarRoom.zip",
  122. ArchiveNumbering = ArchiveNumberingMode.Date,
  123. ArchiveDateFormat = "yyyy-MM-dd",
  124. ArchiveEvery = FileArchivePeriod.Day,
  125. EnableArchiveFileCompression = true,
  126. KeepFileOpen = true,
  127. MaxArchiveFiles = 7
  128. };
  129. }
  130. }