微服务 mybatis-plus 添加日志输出

# spring配置
spring: 
  redis:
    database: 6
    host: 192.168.8.248
    port: 6379
    password: 
  datasource:
    druid:
      stat-view-servlet:
        enabled: true
        loginUsername: admin
        loginPassword: 123456
    dynamic:
      druid:
        initial-size: 5
        min-idle: 5
        maxActive: 20
        maxWait: 60000
        timeBetweenEvictionRunsMillis: 60000
        minEvictableIdleTimeMillis: 300000
        validationQuery: SELECT 1 FROM DUAL
        testWhileIdle: true
        testOnBorrow: false
        testOnReturn: false
        poolPreparedStatements: true
        maxPoolPreparedStatementPerConnectionSize: 20
        filters: stat,wall,slf4j
        connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
      datasource:
          # 主库数据源
          master:
            driver-class-name: com.mysql.cj.jdbc.Driver
            url: jdbc:mysql://192.168.8.248:3306/huajun-cloud-event?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai
            username: root
            password: root
          # 从库数据源
          # slave:
            # username: 
            # password: 
            # url: 
            # driver-class-name: 
      # seata: true    # 开启seata代理,开启后默认每个数据源都代理,如果某个不需要代理可单独关闭

  # rabbitmq配置
  rabbitmq:
    host: 192.168.8.201
    username: admin
    password: admin
    port: 5672
    publisher-confirms: true
    publisher-returns: true
    virtual-host: /
    listener:
      simple:
        acknowledge-mode: manual
        #消费者的最小数量
        concurrency: 1
        #消费者的最大数量
        max-concurrency: 1
        #是否支持重试
        retry:
          enabled: true

# seata配置
seata:
  # 默认关闭,如需启用spring.datasource.dynami.seata需要同时开启
  enabled: false
  # Seata 应用编号,默认为 ${spring.application.name}
  application-id: ${spring.application.name}
  # Seata 事务组编号,用于 TC 集群名
  tx-service-group: ${spring.application.name}-group
  # 关闭自动代理
  enable-auto-data-source-proxy: false
  config:
    type: nacos
    nacos:
      serverAddr: 192.168.8.201:8848
      group: SEATA_GROUP
      namespace: ffbdf183-c35e-41ea-8166-e807b6968b93
  registry:
    type: nacos
    nacos:
      application: seata-server
      server-addr: 192.168.8.201:8848
      group: SEATA_GROUP
      namespace: ffbdf183-c35e-41ea-8166-e807b6968b93

# mybatis配置
mybatis-plus:
    # 搜索指定包别名
    typeAliasesPackage: com.huajun.event
    # 配置mapper的扫描,找到所有的mapper.xml映射文件
    mapperLocations: classpath:mapper/**/*.xml
    configuration:
      log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    global-config:
      db-config:
        id-type: assign_uuid
        capital-mode: false

        logic-delete-field: delFlag  # 全局逻辑删除的实体字段名(since 3.3.0,配置后可以忽略不配置步骤2)
        logic-delete-value: 2 # 逻辑已删除值(默认为 1)
        logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)

# swagger配置
swagger:
  title: 指挥救援系统接口文档
  license: Powered By huajun
  licenseUrl: http://www.huajuntec.com.cn

# xxl-job分布式任务配置
xxljob:
  adminAddresses: http://192.168.8.201:9080/xxl-job-admin
  accessToken: ''
  appname: ${spring.application.name}
  address: 
  ip: 
  port: 0
  logPath: 
  logRetentionDays: 30

 

上一篇:分布式事务seata从入门到放弃


下一篇:jpa jpql @query 动态查询