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.

86 lines
3.3 KiB

1 year ago
1 year ago
1 year ago
  1. <Configuration status="INFO" packages="com.digiwin.app.log">
  2. <Properties>
  3. <Property name="LOG_PATTERN">
  4. %d{yyyy/MM/dd HH:mm:ss} %-5p [%X{traceId}] %m%n
  5. </Property>
  6. </Properties>
  7. <Appenders>
  8. <Console name="consoleAppender" target="SYSTEM_OUT" follow="true">
  9. <PatternLayout pattern="${LOG_PATTERN}" />
  10. </Console>
  11. <RollingFile name="rollingfileAppender" fileName="platform/log/Digiwin${sys:logFileIdentifier}.log"
  12. filePattern="platform/log/Digiwin${sys:logFileIdentifier}-%d{yyyy-MM-dd}.log" append="true">
  13. <PatternLayout pattern="${LOG_PATTERN}" />
  14. <Filters>
  15. <ThresholdFilter level="fatal" onMatch="ACCEPT"
  16. onMismatch="NEUTRAL" />
  17. <ThresholdFilter level="error" onMatch="ACCEPT"
  18. onMismatch="NEUTRAL" />
  19. <ThresholdFilter level="warn" onMatch="ACCEPT"
  20. onMismatch="NEUTRAL" />
  21. <ThresholdFilter level="info" onMatch="ACCEPT"
  22. onMismatch="NEUTRAL" />
  23. <ThresholdFilter level="debug" onMatch="ACCEPT"
  24. onMismatch="DENY" />
  25. </Filters>
  26. <Policies>
  27. <TimeBasedTriggeringPolicy />
  28. </Policies>
  29. <DefaultRolloverStrategy>
  30. <Delete basePath="platform/log/" maxDepth="1" followLinks="true">
  31. <IfFileName glob="Digiwin-*.log" />
  32. <IfLastModified age="@logFileReservedDay@" />
  33. </Delete>
  34. </DefaultRolloverStrategy>
  35. </RollingFile>
  36. <!-- DwMongoDBAppender name="logServiceLogAppender" databaseName="dap" collectionName="logs" server="@logMongodbServer@" port="@logMongodbPort@">
  37. <PatternLayout pattern="${LOG_PATTERN}" />
  38. </DwMongoDBAppender>
  39. <DwMongoDBAppender name="logServiceTraceAppender" databaseName="dap" collectionName="traces" server="@logMongodbServer@" port="@logMongodbPort@">
  40. <PatternLayout pattern="${LOG_PATTERN}" />
  41. </DwMongoDBAppender>
  42. <DwLogMongoAppender name="mongoSysAppender" databaseName="dap" collectionName="logs" server="@logMongodbServer@" port="@logMongodbPort@">
  43. <PatternLayout pattern="${LOG_PATTERN}" />
  44. </DwLogMongoAppender>
  45. <Async name="asyncSysAppender">
  46. <AppenderRef ref="mongoSysAppender"/>
  47. </Async-->
  48. <!-- 1.引入appender -->
  49. <DwLog4j2Appender name="dwAppender" app="demo-athenaopt" endpoint="@lmcUrl@">
  50. <PatternLayout pattern="${LOG_PATTERN}"/>
  51. </DwLog4j2Appender>
  52. <!-- 2.引入异步节点 -->
  53. <Async name="ASYNC-dwAppender">
  54. <AppenderRef ref="dwAppender"/>
  55. </Async>
  56. </Appenders>
  57. <Loggers>
  58. <!--<Root level="@logLevel@">-->
  59. <Root level="ERROR">
  60. <!-- 3.引入使用 -->
  61. <appender-ref ref="ASYNC-dwAppender"/>
  62. <appender-ref ref="consoleAppender" />
  63. <appender-ref ref="rollingfileAppender" />
  64. <!-- appender-ref ref="asyncSysAppender" /-->
  65. </Root>
  66. <logger name="io.lettuce.core.protocol" level="ERROR">
  67. <appender-ref ref="consoleAppender" />
  68. <appender-ref ref="rollingfileAppender" />
  69. </logger>
  70. <!-- Logger name="com.digiwin.dwsys.service.impl.LogLogger" level="@logLevel@" additivity="false">
  71. <appender-ref ref="logServiceLogAppender" />
  72. </Logger>
  73. <Logger name="com.digiwin.dwsys.service.impl.TraceLogger" level="@logLevel@" additivity="false">
  74. <appender-ref ref="logServiceTraceAppender" />
  75. </Logger>
  76. <Logger name="org.mongodb.driver" level="ERROR" additivity="false">
  77. <appender-ref ref="rollingfileAppender" />
  78. </Logger-->
  79. </Loggers>
  80. </Configuration>