2.0重构版本
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 
 
 
 

118 рядки
4.3 KiB

  1. <configuration scan="true" scanPeriod=" 5 seconds">
  2. <jmxConfigurator />
  3. <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  4. <encoder>
  5. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56} - %msg%n
  6. </pattern>
  7. </encoder>
  8. </appender>
  9. <appender name="CANAL-ROOT" class="ch.qos.logback.classic.sift.SiftingAppender">
  10. <discriminator>
  11. <Key>destination</Key>
  12. <DefaultValue>canal</DefaultValue>
  13. </discriminator>
  14. <sift>
  15. <appender name="FILE-${destination}" class="ch.qos.logback.core.rolling.RollingFileAppender">
  16. <File>../logs/${destination}/${destination}.log</File>
  17. <rollingPolicy
  18. class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  19. <!-- rollover daily -->
  20. <fileNamePattern>../logs/${destination}/%d{yyyy-MM-dd}/${destination}-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
  21. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  22. <!-- or whenever the file size reaches 100MB -->
  23. <maxFileSize>512MB</maxFileSize>
  24. </timeBasedFileNamingAndTriggeringPolicy>
  25. <maxHistory>60</maxHistory>
  26. </rollingPolicy>
  27. <encoder>
  28. <pattern>
  29. %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56} - %msg%n
  30. </pattern>
  31. </encoder>
  32. </appender>
  33. </sift>
  34. </appender>
  35. <appender name="CANAL-META" class="ch.qos.logback.classic.sift.SiftingAppender">
  36. <discriminator>
  37. <Key>destination</Key>
  38. <DefaultValue>canal</DefaultValue>
  39. </discriminator>
  40. <sift>
  41. <appender name="META-FILE-${destination}" class="ch.qos.logback.core.rolling.RollingFileAppender">
  42. <File>../logs/${destination}/meta.log</File>
  43. <rollingPolicy
  44. class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  45. <!-- rollover daily -->
  46. <fileNamePattern>../logs/${destination}/%d{yyyy-MM-dd}/meta-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
  47. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  48. <!-- or whenever the file size reaches 100MB -->
  49. <maxFileSize>32MB</maxFileSize>
  50. </timeBasedFileNamingAndTriggeringPolicy>
  51. <maxHistory>60</maxHistory>
  52. </rollingPolicy>
  53. <encoder>
  54. <pattern>
  55. %d{yyyy-MM-dd HH:mm:ss.SSS} - %msg%n
  56. </pattern>
  57. </encoder>
  58. </appender>
  59. </sift>
  60. </appender>
  61. <appender name="RocketmqClientAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
  62. <file>../logs/canal/rocketmq_client.log</file>
  63. <rollingPolicy
  64. class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
  65. <!-- rollover daily -->
  66. <fileNamePattern>../logs/canal/%d{yyyy-MM-dd}/rocketmq_client-%d{yyyy-MM-dd}-%i.log.gz</fileNamePattern>
  67. <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
  68. <!-- or whenever the file size reaches 100MB -->
  69. <maxFileSize>512MB</maxFileSize>
  70. </timeBasedFileNamingAndTriggeringPolicy>
  71. <maxHistory>60</maxHistory>
  72. </rollingPolicy>
  73. <encoder charset="UTF-8">
  74. <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{56} - %msg%n</pattern>
  75. </encoder>
  76. </appender>
  77. <logger name="com.alibaba.otter.canal.instance" additivity="false">
  78. <level value="INFO" />
  79. <appender-ref ref="CANAL-ROOT" />
  80. </logger>
  81. <logger name="com.alibaba.otter.canal.deployer" additivity="false">
  82. <level value="INFO" />
  83. <appender-ref ref="CANAL-ROOT" />
  84. </logger>
  85. <logger name="com.alibaba.otter.canal.meta.FileMixedMetaManager" additivity="false">
  86. <level value="INFO" />
  87. <appender-ref ref="CANAL-META" />
  88. </logger>
  89. <logger name="com.alibaba.otter.canal.connector.kafka" additivity="false">
  90. <level value="INFO" />
  91. <appender-ref ref="CANAL-ROOT" />
  92. </logger>
  93. <logger name="com.alibaba.otter.canal.connector.rocketmq" additivity="false">
  94. <level value="INFO" />
  95. <appender-ref ref="CANAL-ROOT" />
  96. </logger>
  97. <logger name="com.alibaba.otter.canal.connector.rabbitmq" additivity="false">
  98. <level value="INFO" />
  99. <appender-ref ref="CANAL-ROOT" />
  100. </logger>
  101. <logger name="RocketmqClient" additivity="false">
  102. <level value="INFO" />
  103. <appender-ref ref="RocketmqClientAppender" />
  104. </logger>
  105. <logger name="com.alibaba.otter.canal.connector.pulsarmq" additivity="false">
  106. <level value="INFO" />
  107. <appender-ref ref="CANAL-ROOT" />
  108. </logger>
  109. <root level="WARN">
  110. <!-- <appender-ref ref="STDOUT"/> -->
  111. <appender-ref ref="CANAL-ROOT" />
  112. </root>
  113. </configuration>