nacos-logback.xml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration scan="true" scanPeriod="10 seconds">
  3. <springProperty scope="context" name="logPath" source="nacos.logs.path" defaultValue="${nacos.home}/logs"/>
  4. <property name="LOG_HOME" value="${logPath}"/>
  5. <appender name="cmdb-main"
  6. class="ch.qos.logback.core.rolling.RollingFileAppender">
  7. <file>${nacos.home}/logs/cmdb-main.log</file>
  8. <append>true</append>
  9. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  10. <fileNamePattern>${nacos.home}/logs/cmdb-main.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  11. <maxFileSize>2GB</maxFileSize>
  12. <MaxHistory>7</MaxHistory>
  13. <totalSizeCap>7GB</totalSizeCap>
  14. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  15. </rollingPolicy>
  16. <encoder>
  17. <Pattern>%date %level %msg%n%n</Pattern>
  18. <charset>UTF-8</charset>
  19. </encoder>
  20. </appender>
  21. <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
  22. <encoder>
  23. <Pattern>%date %level %msg%n%n</Pattern>
  24. <charset>UTF-8</charset>
  25. </encoder>
  26. </appender>
  27. <appender name="naming-server"
  28. class="ch.qos.logback.core.rolling.RollingFileAppender">
  29. <file>${LOG_HOME}/naming-server.log</file>
  30. <append>true</append>
  31. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  32. <fileNamePattern>${LOG_HOME}/naming-server.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  33. <maxFileSize>1GB</maxFileSize>
  34. <MaxHistory>7</MaxHistory>
  35. <totalSizeCap>7GB</totalSizeCap>
  36. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  37. </rollingPolicy>
  38. <encoder>
  39. <Pattern>%date %level %msg%n%n</Pattern>
  40. <charset>UTF-8</charset>
  41. </encoder>
  42. </appender>
  43. <appender name="async-naming-server" class="ch.qos.logback.classic.AsyncAppender">
  44. <discardingThreshold>0</discardingThreshold>
  45. <queueSize>1024</queueSize>
  46. <neverBlock>true</neverBlock>
  47. <appender-ref ref="naming-server"/>
  48. </appender>
  49. <appender name="naming-raft"
  50. class="ch.qos.logback.core.rolling.RollingFileAppender">
  51. <file>${LOG_HOME}/naming-raft.log</file>
  52. <append>true</append>
  53. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  54. <fileNamePattern>${LOG_HOME}/naming-raft.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  55. <maxFileSize>1GB</maxFileSize>
  56. <MaxHistory>7</MaxHistory>
  57. <totalSizeCap>3GB</totalSizeCap>
  58. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  59. </rollingPolicy>
  60. <encoder>
  61. <Pattern>%date %level %msg%n%n</Pattern>
  62. <charset>UTF-8</charset>
  63. </encoder>
  64. </appender>
  65. <appender name="async-naming-raft" class="ch.qos.logback.classic.AsyncAppender">
  66. <discardingThreshold>0</discardingThreshold>
  67. <queueSize>1024</queueSize>
  68. <neverBlock>true</neverBlock>
  69. <appender-ref ref="naming-raft"/>
  70. </appender>
  71. <appender name="naming-distro"
  72. class="ch.qos.logback.core.rolling.RollingFileAppender">
  73. <file>${LOG_HOME}/naming-distro.log</file>
  74. <append>true</append>
  75. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  76. <fileNamePattern>${LOG_HOME}/naming-distro.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  77. <maxFileSize>1GB</maxFileSize>
  78. <MaxHistory>7</MaxHistory>
  79. <totalSizeCap>3GB</totalSizeCap>
  80. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  81. </rollingPolicy>
  82. <encoder>
  83. <Pattern>%date %level %msg%n%n</Pattern>
  84. <charset>UTF-8</charset>
  85. </encoder>
  86. </appender>
  87. <appender name="async-naming-distro" class="ch.qos.logback.classic.AsyncAppender">
  88. <discardingThreshold>0</discardingThreshold>
  89. <queueSize>1024</queueSize>
  90. <neverBlock>true</neverBlock>
  91. <appender-ref ref="naming-distro"/>
  92. </appender>
  93. <appender name="naming-event"
  94. class="ch.qos.logback.core.rolling.RollingFileAppender">
  95. <file>${LOG_HOME}/naming-event.log</file>
  96. <append>true</append>
  97. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  98. <fileNamePattern>${LOG_HOME}/naming-event.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  99. <maxFileSize>1GB</maxFileSize>
  100. <MaxHistory>7</MaxHistory>
  101. <totalSizeCap>3GB</totalSizeCap>
  102. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  103. </rollingPolicy>
  104. <encoder>
  105. <Pattern>%date %level %msg%n%n</Pattern>
  106. <charset>UTF-8</charset>
  107. </encoder>
  108. </appender>
  109. <appender name="async-naming-event" class="ch.qos.logback.classic.AsyncAppender">
  110. <discardingThreshold>0</discardingThreshold>
  111. <queueSize>1024</queueSize>
  112. <neverBlock>true</neverBlock>
  113. <appender-ref ref="naming-event"/>
  114. </appender>
  115. <appender name="naming-push"
  116. class="ch.qos.logback.core.rolling.RollingFileAppender">
  117. <file>${LOG_HOME}/naming-push.log</file>
  118. <append>true</append>
  119. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  120. <fileNamePattern>${LOG_HOME}/naming-push.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  121. <maxFileSize>1GB</maxFileSize>
  122. <MaxHistory>7</MaxHistory>
  123. <totalSizeCap>3GB</totalSizeCap>
  124. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  125. </rollingPolicy>
  126. <encoder>
  127. <Pattern>%date %level %msg%n%n</Pattern>
  128. <charset>UTF-8</charset>
  129. </encoder>
  130. </appender>
  131. <appender name="naming-rt"
  132. class="ch.qos.logback.core.rolling.RollingFileAppender">
  133. <file>${LOG_HOME}/naming-rt.log</file>
  134. <append>true</append>
  135. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  136. <fileNamePattern>${LOG_HOME}/naming-rt.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  137. <maxFileSize>1GB</maxFileSize>
  138. <MaxHistory>7</MaxHistory>
  139. <totalSizeCap>3GB</totalSizeCap>
  140. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  141. </rollingPolicy>
  142. <encoder>
  143. <Pattern>%msg%n</Pattern>
  144. <charset>UTF-8</charset>
  145. </encoder>
  146. </appender>
  147. <appender name="naming-performance"
  148. class="ch.qos.logback.core.rolling.RollingFileAppender">
  149. <file>${LOG_HOME}/naming-performance.log</file>
  150. <append>true</append>
  151. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  152. <fileNamePattern>${LOG_HOME}/naming-performance.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  153. <maxFileSize>1GB</maxFileSize>
  154. <MaxHistory>7</MaxHistory>
  155. <totalSizeCap>3GB</totalSizeCap>
  156. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  157. </rollingPolicy>
  158. <encoder>
  159. <Pattern>%date %level %msg%n%n</Pattern>
  160. <charset>UTF-8</charset>
  161. </encoder>
  162. </appender>
  163. <!--config module logback config-->
  164. <appender name="dumpFile"
  165. class="ch.qos.logback.core.rolling.RollingFileAppender">
  166. <file>${LOG_HOME}/config-dump.log</file>
  167. <append>true</append>
  168. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  169. <fileNamePattern>${LOG_HOME}/config-dump.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  170. <maxFileSize>2GB</maxFileSize>
  171. <MaxHistory>7</MaxHistory>
  172. <totalSizeCap>7GB</totalSizeCap>
  173. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  174. </rollingPolicy>
  175. <encoder>
  176. <Pattern>%date %level %msg%n%n</Pattern>
  177. <charset>UTF-8</charset>
  178. </encoder>
  179. </appender>
  180. <appender name="pullFile"
  181. class="ch.qos.logback.core.rolling.RollingFileAppender">
  182. <file>${LOG_HOME}/config-pull.log</file>
  183. <append>true</append>
  184. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  185. <fileNamePattern>${LOG_HOME}/config-pull.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  186. <maxFileSize>20MB</maxFileSize>
  187. <MaxHistory>7</MaxHistory>
  188. <totalSizeCap>128MB</totalSizeCap>
  189. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  190. </rollingPolicy>
  191. <encoder>
  192. <Pattern>%date %level %msg%n%n</Pattern>
  193. <charset>UTF-8</charset>
  194. </encoder>
  195. </appender>
  196. <appender name="fatalFile"
  197. class="ch.qos.logback.core.rolling.RollingFileAppender">
  198. <file>${LOG_HOME}/config-fatal.log</file>
  199. <append>true</append>
  200. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  201. <fileNamePattern>${LOG_HOME}/config-fatal.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  202. <maxFileSize>20MB</maxFileSize>
  203. <MaxHistory>7</MaxHistory>
  204. <totalSizeCap>128MB</totalSizeCap>
  205. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  206. </rollingPolicy>
  207. <encoder>
  208. <Pattern>%date %level %msg%n%n</Pattern>
  209. <charset>UTF-8</charset>
  210. </encoder>
  211. </appender>
  212. <appender name="memoryFile"
  213. class="ch.qos.logback.core.rolling.RollingFileAppender">
  214. <file>${LOG_HOME}/config-memory.log</file>
  215. <append>true</append>
  216. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  217. <fileNamePattern>${LOG_HOME}/config-memory.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  218. <maxFileSize>20MB</maxFileSize>
  219. <MaxHistory>7</MaxHistory>
  220. <totalSizeCap>128MB</totalSizeCap>
  221. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  222. </rollingPolicy>
  223. <encoder>
  224. <Pattern>%date %level %msg%n%n</Pattern>
  225. <charset>UTF-8</charset>
  226. </encoder>
  227. </appender>
  228. <appender name="pullCheckFile"
  229. class="ch.qos.logback.core.rolling.RollingFileAppender">
  230. <file>${LOG_HOME}/config-pull-check.log</file>
  231. <append>true</append>
  232. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  233. <fileNamePattern>${LOG_HOME}/config-pull-check.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  234. <maxFileSize>1GB</maxFileSize>
  235. <MaxHistory>7</MaxHistory>
  236. <totalSizeCap>3GB</totalSizeCap>
  237. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  238. </rollingPolicy>
  239. <encoder>
  240. <Pattern>%msg%n</Pattern>
  241. <charset>UTF-8</charset>
  242. </encoder>
  243. </appender>
  244. <appender name="clientLog"
  245. class="ch.qos.logback.core.rolling.RollingFileAppender">
  246. <file>${LOG_HOME}/config-client-request.log</file>
  247. <append>true</append>
  248. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  249. <fileNamePattern>${LOG_HOME}/config-client-request.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  250. <maxFileSize>2GB</maxFileSize>
  251. <MaxHistory>7</MaxHistory>
  252. <totalSizeCap>7GB</totalSizeCap>
  253. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  254. </rollingPolicy>
  255. <encoder>
  256. <Pattern>%date|%msg%n</Pattern>
  257. <charset>UTF-8</charset>
  258. </encoder>
  259. </appender>
  260. <appender name="traceLog"
  261. class="ch.qos.logback.core.rolling.RollingFileAppender">
  262. <file>${LOG_HOME}/config-trace.log</file>
  263. <append>true</append>
  264. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  265. <fileNamePattern>${LOG_HOME}/config-trace.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  266. <maxFileSize>2GB</maxFileSize>
  267. <MaxHistory>7</MaxHistory>
  268. <totalSizeCap>7GB</totalSizeCap>
  269. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  270. </rollingPolicy>
  271. <encoder>
  272. <Pattern>%date|%msg%n</Pattern>
  273. <charset>UTF-8</charset>
  274. </encoder>
  275. </appender>
  276. <appender name="notifyLog"
  277. class="ch.qos.logback.core.rolling.RollingFileAppender">
  278. <file>${LOG_HOME}/config-notify.log</file>
  279. <append>true</append>
  280. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  281. <fileNamePattern>${LOG_HOME}/config-notify.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  282. <maxFileSize>1GB</maxFileSize>
  283. <MaxHistory>7</MaxHistory>
  284. <totalSizeCap>3GB</totalSizeCap>
  285. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  286. </rollingPolicy>
  287. <encoder>
  288. <Pattern>%date %level %msg%n%n</Pattern>
  289. <charset>UTF-8</charset>
  290. </encoder>
  291. </appender>
  292. <appender name="startLog"
  293. class="ch.qos.logback.core.rolling.RollingFileAppender">
  294. <file>${LOG_HOME}/config-server.log</file>
  295. <append>true</append>
  296. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  297. <fileNamePattern>${LOG_HOME}/config-server.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  298. <maxFileSize>50MB</maxFileSize>
  299. <MaxHistory>7</MaxHistory>
  300. <totalSizeCap>512MB</totalSizeCap>
  301. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  302. </rollingPolicy>
  303. <encoder>
  304. <Pattern>%date %level %msg%n%n</Pattern>
  305. <charset>UTF-8</charset>
  306. </encoder>
  307. </appender>
  308. <appender name="rootFile"
  309. class="ch.qos.logback.core.rolling.RollingFileAppender">
  310. <file>${LOG_HOME}/nacos.log</file>
  311. <append>true</append>
  312. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  313. <fileNamePattern>${LOG_HOME}/nacos.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  314. <maxFileSize>50MB</maxFileSize>
  315. <MaxHistory>7</MaxHistory>
  316. <totalSizeCap>512MB</totalSizeCap>
  317. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  318. </rollingPolicy>
  319. <encoder>
  320. <Pattern>%date %level %msg%n%n</Pattern>
  321. <charset>UTF-8</charset>
  322. </encoder>
  323. </appender>
  324. <appender name="nacos-address"
  325. class="ch.qos.logback.core.rolling.RollingFileAppender">
  326. <file>${LOG_HOME}/nacos-address.log</file>
  327. <append>true</append>
  328. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  329. <fileNamePattern>${LOG_HOME}/nacos-address.log.%d{yyyy-MM-dd}.%i</fileNamePattern>
  330. <maxFileSize>2GB</maxFileSize>
  331. <MaxHistory>7</MaxHistory>
  332. <totalSizeCap>7GB</totalSizeCap>
  333. <cleanHistoryOnStart>true</cleanHistoryOnStart>
  334. </rollingPolicy>
  335. <encoder>
  336. <Pattern>%date %level %msg%n%n</Pattern>
  337. <charset>UTF-8</charset>
  338. </encoder>
  339. </appender>
  340. <logger name="com.alibaba.nacos.address.main" additivity="false">
  341. <level value="INFO"/>
  342. <appender-ref ref="nacos-address"/>
  343. </logger>
  344. <logger name="com.alibaba.nacos.cmdb.main" additivity="false">
  345. <level value="INFO"/>
  346. <appender-ref ref="cmdb-main"/>
  347. </logger>
  348. <logger name="com.alibaba.nacos.naming.main" additivity="false">
  349. <level value="INFO"/>
  350. <appender-ref ref="async-naming-server"/>
  351. </logger>
  352. <logger name="com.alibaba.nacos.naming.raft" additivity="false">
  353. <level value="INFO"/>
  354. <appender-ref ref="async-naming-raft"/>
  355. </logger>
  356. <logger name="com.alibaba.nacos.naming.distro" additivity="false">
  357. <level value="INFO"/>
  358. <appender-ref ref="async-naming-distro"/>
  359. </logger>
  360. <logger name="com.alibaba.nacos.naming.event" additivity="false">
  361. <level value="INFO"/>
  362. <appender-ref ref="async-naming-event"/>
  363. </logger>
  364. <logger name="com.alibaba.nacos.naming.push" additivity="false">
  365. <level value="INFO"/>
  366. <appender-ref ref="naming-push"/>
  367. </logger>
  368. <logger name="com.alibaba.nacos.naming.rt" additivity="false">
  369. <level value="INFO"/>
  370. <appender-ref ref="naming-rt"/>
  371. </logger>
  372. <logger name="com.alibaba.nacos.naming.performance" additivity="false">
  373. <level value="INFO"/>
  374. <appender-ref ref="naming-performance"/>
  375. </logger>
  376. <logger name="com.alibaba.nacos.config.dumpLog" additivity="false">
  377. <level value="INFO"/>
  378. <appender-ref ref="dumpFile"/>
  379. </logger>
  380. <logger name="com.alibaba.nacos.config.pullLog" additivity="false">
  381. <level value="INFO"/>
  382. <appender-ref ref="pullFile"/>
  383. </logger>
  384. <logger name="com.alibaba.nacos.config.pullCheckLog" additivity="false">
  385. <level value="INFO"/>
  386. <appender-ref ref="pullCheckFile"/>
  387. </logger>
  388. <logger name="com.alibaba.nacos.config.fatal" additivity="false">
  389. <level value="INFO"/>
  390. <appender-ref ref="fatalFile"/>
  391. </logger>
  392. <logger name="com.alibaba.nacos.config.monitorLog" additivity="false">
  393. <level value="INFO"/>
  394. <appender-ref ref="memoryFile"/>
  395. </logger>
  396. <logger name="com.alibaba.nacos.config.clientLog" additivity="false">
  397. <level value="info"/>
  398. <appender-ref ref="clientLog"/>
  399. </logger>
  400. <logger name="com.alibaba.nacos.config.notifyLog" additivity="false">
  401. <level value="INFO"/>
  402. <appender-ref ref="notifyLog"/>
  403. </logger>
  404. <logger name="com.alibaba.nacos.config.traceLog" additivity="false">
  405. <level value="info"/>
  406. <appender-ref ref="traceLog"/>
  407. </logger>
  408. <logger name="com.alibaba.nacos.config.startLog" additivity="false">
  409. <level value="INFO"/>
  410. <appender-ref ref="startLog"/>
  411. </logger>
  412. <springProfile name="standalone">
  413. <logger name="org.springframework">
  414. <appender-ref ref="CONSOLE"/>
  415. <level value="INFO"/>
  416. </logger>
  417. <logger name="org.apache.catalina.startup.DigesterFactory">
  418. <appender-ref ref="CONSOLE"/>
  419. <level value="INFO"/>
  420. </logger>
  421. <logger name="org.apache.catalina.util.LifecycleBase">
  422. <appender-ref ref="CONSOLE"/>
  423. <level value="ERROR"/>
  424. </logger>
  425. <logger name="org.apache.coyote.http11.Http11NioProtocol">
  426. <appender-ref ref="CONSOLE"/>
  427. <level value="WARN"/>
  428. </logger>
  429. <logger name="org.apache.tomcat.util.net.NioSelectorPool">
  430. <appender-ref ref="CONSOLE"/>
  431. <level value="WARN"/>
  432. </logger>
  433. </springProfile>
  434. <logger name="com.alibaba.nacos.core.listener.StartingSpringApplicationRunListener">
  435. <appender-ref ref="CONSOLE"/>
  436. <level value="INFO"/>
  437. </logger>
  438. <root>
  439. <level value="INFO"/>
  440. <appender-ref ref="rootFile"/>
  441. </root>
  442. </configuration>