logback-spring.xml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. ~ Copyright 1999-2019 Seata.io Group.
  4. ~
  5. ~ Licensed under the Apache License, Version 2.0 (the "License");
  6. ~ you may not use this file except in compliance with the License.
  7. ~ You may obtain a copy of the License at
  8. ~
  9. ~ http://www.apache.org/licenses/LICENSE-2.0
  10. ~
  11. ~ Unless required by applicable law or agreed to in writing, software
  12. ~ distributed under the License is distributed on an "AS IS" BASIS,
  13. ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ~ See the License for the specific language governing permissions and
  15. ~ limitations under the License.
  16. -->
  17. <configuration scan="true" scanPeriod="60 seconds" debug="false">
  18. <!-- Context listeners -->
  19. <contextListener class="org.apache.seata.server.logging.listener.SystemPropertyLoggerContextListener"/>
  20. <!-- common properties -->
  21. <springProperty name="PORT" source="server.port" defaultValue="7091"/>
  22. <springProperty name="APPLICATION_NAME" source="spring.application.name" defaultValue="seata-server"/>
  23. <!-- 日志存放路径 -->
  24. <property name="log.path" value="logs/${project.artifactId}"/>
  25. <!-- 日志输出格式 -->
  26. <property name="console.log.pattern"
  27. value="%cyan(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
  28. <!-- 控制台输出 -->
  29. <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
  30. <encoder>
  31. <pattern>${console.log.pattern}</pattern>
  32. <charset>utf-8</charset>
  33. </encoder>
  34. </appender>
  35. <include resource="logback-common.xml" />
  36. <include resource="logback-logstash.xml" />
  37. <!-- 开启 skywalking 日志收集 -->
  38. <include resource="logback-skylog.xml" />
  39. <root level="INFO">
  40. <appender-ref ref="console"/>
  41. </root>
  42. </configuration>