Project

General

Profile

Defect #2684 » logback-spring.xml

Alena Peterová, 02/12/2021 02:32 PM

 
1
<?xml version="1.0" encoding="UTF-8"?>
2
<!-- https://springframework.guru/using-logback-spring-boot/ -->
3
<!-- http://logback.qos.ch/manual/appenders.html -->
4
<!DOCTYPE configuration>
5
<configuration>
6
  <include resource="org/springframework/boot/logging/logback/base.xml"/>
7
  <springProperty name="spring.profiles.active" source="spring.profiles.active"/>
8
  <springProfile name="docker">
9
    <springProperty name="spring.datasource.driver-class-name" source="spring.datasource.driver-class-name"/>
10
    <springProperty name="spring.datasource.url" source="spring.datasource.url"/>
11
    <springProperty name="spring.datasource.username" source="spring.datasource.username"/>
12
    <springProperty name="spring.datasource.password" source="spring.datasource.password"/>
13
    <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
14
      <connectionSource class="ch.qos.logback.core.db.DriverManagerConnectionSource">
15
        <driverClass>${spring.datasource.driver-class-name}</driverClass>
16
        <url>${spring.datasource.url}</url>
17
        <user>${spring.datasource.username}</user>
18
        <password>${spring.datasource.password}</password>
19
      </connectionSource>
20
    </appender>
21
    <appender name="DB_ASYNC" class="ch.qos.logback.classic.AsyncAppender">
22
      <appender-ref ref="DB"/>
23
      <includeCallerData>true</includeCallerData>
24
    </appender>
25
    <logger name="eu.bcvsolutions" level="INFO">
26
      <appender-ref ref="DB_ASYNC"/>
27
    </logger>
28
    <logger name="org.springframework" level="INFO"/>
29
    <logger name="org.springframework.web" level="INFO"/>
30
    <logger name="org.hibernate.SQL" level="INFO"/>
31
    <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="INFO"/>
32
  </springProfile>
33
</configuration>
    (1-1/1)