logback-worker.xml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Licensed to the Apache Software Foundation (ASF) under one or more
  4. ~ contributor license agreements. See the NOTICE file distributed with
  5. ~ this work for additional information regarding copyright ownership.
  6. ~ The ASF licenses this file to You under the Apache License, Version 2.0
  7. ~ (the "License"); you may not use this file except in compliance with
  8. ~ the License. You may obtain a copy of the License at
  9. ~
  10. ~ http://www.apache.org/licenses/LICENSE-2.0
  11. ~
  12. ~ Unless required by applicable law or agreed to in writing, software
  13. ~ distributed under the License is distributed on an "AS IS" BASIS,
  14. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. ~ See the License for the specific language governing permissions and
  16. ~ limitations under the License.
  17. -->
  18. <!-- Logback configuration. See http://logback.qos.ch/manual/index.html -->
  19. <configuration scan="true" scanPeriod="120 seconds"> <!--debug="true" -->
  20. <property name="log.base" value="logs"/>
  21. <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  22. <encoder>
  23. <pattern>
  24. [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
  25. </pattern>
  26. <charset>UTF-8</charset>
  27. </encoder>
  28. </appender>
  29. <!-- worker server logback config start -->
  30. <conversionRule conversionWord="messsage"
  31. converterClass="org.apache.dolphinscheduler.server.log.SensitiveDataConverter"/>
  32. <appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender">
  33. <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  34. <level>INFO</level>
  35. </filter> -->
  36. <filter class="org.apache.dolphinscheduler.server.log.TaskLogFilter"/>
  37. <Discriminator class="org.apache.dolphinscheduler.server.log.TaskLogDiscriminator">
  38. <key>taskAppId</key>
  39. <logBase>${log.base}</logBase>
  40. </Discriminator>
  41. <sift>
  42. <appender name="FILE-${taskAppId}" class="ch.qos.logback.core.FileAppender">
  43. <file>${log.base}/${taskAppId}.log</file>
  44. <encoder>
  45. <pattern>
  46. [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
  47. </pattern>
  48. <charset>UTF-8</charset>
  49. </encoder>
  50. <append>true</append>
  51. </appender>
  52. </sift>
  53. </appender>
  54. <appender name="WORKERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  55. <file>${log.base}/dolphinscheduler-worker.log</file>
  56. <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  57. <level>INFO</level>
  58. </filter> -->
  59. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  60. <fileNamePattern>${log.base}/dolphinscheduler-worker.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
  61. <maxHistory>168</maxHistory>
  62. <maxFileSize>200MB</maxFileSize>
  63. </rollingPolicy>
  64. <encoder>
  65. <pattern>
  66. [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
  67. </pattern>
  68. <charset>UTF-8</charset>
  69. </encoder>
  70. </appender>
  71. <!-- worker server logback config end -->
  72. <root level="INFO">
  73. <appender-ref ref="STDOUT"/>
  74. <appender-ref ref="TASKLOGFILE"/>
  75. <appender-ref ref="WORKERLOGFILE"/>
  76. </root>
  77. </configuration>