logback-master.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. <conversionRule conversionWord="messsage"
  30. converterClass="org.apache.dolphinscheduler.server.log.SensitiveDataConverter"/>
  31. <appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender">
  32. <!-- <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  33. <level>INFO</level>
  34. </filter> -->
  35. <filter class="org.apache.dolphinscheduler.server.log.TaskLogFilter"/>
  36. <Discriminator class="org.apache.dolphinscheduler.server.log.TaskLogDiscriminator">
  37. <key>taskAppId</key>
  38. <logBase>${log.base}</logBase>
  39. </Discriminator>
  40. <sift>
  41. <appender name="FILE-${taskAppId}" class="ch.qos.logback.core.FileAppender">
  42. <file>${log.base}/${taskAppId}.log</file>
  43. <encoder>
  44. <pattern>
  45. [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %messsage%n
  46. </pattern>
  47. <charset>UTF-8</charset>
  48. </encoder>
  49. <append>true</append>
  50. </appender>
  51. </sift>
  52. </appender>
  53. <!-- master server logback config start -->
  54. <appender name="MASTERLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  55. <file>${log.base}/dolphinscheduler-master.log</file>
  56. <!--<filter class="org.apache.dolphinscheduler.server.log.MasterLogFilter">
  57. <level>INFO</level>
  58. </filter>-->
  59. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  60. <fileNamePattern>${log.base}/dolphinscheduler-master.%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] - %msg%n
  67. </pattern>
  68. <charset>UTF-8</charset>
  69. </encoder>
  70. </appender>
  71. <!-- master server logback config end -->
  72. <root level="INFO">
  73. <appender-ref ref="STDOUT"/>
  74. <appender-ref ref="TASKLOGFILE"/>
  75. <appender-ref ref="MASTERLOGFILE"/>
  76. </root>
  77. </configuration>