combined_logback.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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">
  20. <property name="log.base" value="logs"/>
  21. <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
  22. <encoder>
  23. <pattern>
  24. %highlight([%level]) %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{10}:[%line] - %msg%n
  25. </pattern>
  26. <charset>UTF-8</charset>
  27. </encoder>
  28. </appender>
  29. <appender name="TASKLOGFILE" class="ch.qos.logback.classic.sift.SiftingAppender">
  30. <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
  31. <level>INFO</level>
  32. </filter>
  33. <filter class="org.apache.dolphinscheduler.server.worker.log.TaskLogFilter"></filter>
  34. <Discriminator class="org.apache.dolphinscheduler.server.worker.log.TaskLogDiscriminator">
  35. <key>taskAppId</key>
  36. <logBase>${log.base}</logBase>
  37. </Discriminator>
  38. <sift>
  39. <appender name="FILE-${taskAppId}" class="ch.qos.logback.core.FileAppender">
  40. <file>${log.base}/${taskAppId}.log</file>
  41. <encoder>
  42. <pattern>
  43. [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
  44. </pattern>
  45. <charset>UTF-8</charset>
  46. </encoder>
  47. <append>true</append>
  48. </appender>
  49. </sift>
  50. </appender>
  51. <appender name="COMBINEDLOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
  52. <file>${log.base}/dolphinscheduler-combined.log</file>
  53. <filter class="org.apache.dolphinscheduler.server.worker.log.WorkerLogFilter">
  54. <level>INFO</level>
  55. </filter>
  56. <rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
  57. <fileNamePattern>${log.base}/dolphinscheduler-combined.%d{yyyy-MM-dd_HH}.%i.log</fileNamePattern>
  58. <maxHistory>168</maxHistory>
  59. <maxFileSize>200MB</maxFileSize>
  60. </rollingPolicy>
  61.      
  62. <encoder>
  63. <pattern>
  64. [%level] %date{yyyy-MM-dd HH:mm:ss.SSS} %logger{96}:[%line] - %msg%n
  65. </pattern>
  66. <charset>UTF-8</charset>
  67. </encoder>
  68.   
  69. </appender>
  70. <root level="INFO">
  71. <appender-ref ref="STDOUT"/>
  72. <appender-ref ref="TASKLOGFILE"/>
  73. <appender-ref ref="COMBINEDLOGFILE"/>
  74. </root>
  75. </configuration>