Configuration:
  status: warn

  Properties: # 定义全局变量
    Property: # 缺省配置（用于开发环境）。其他环境需要在VM参数中指定，如下：
      #测试：-Dlog.level.console=warn -Dlog.level.xjj=trace
      #生产：-Dlog.level.console=warn -Dlog.level.xjj=info
      - name: log.level.console
        value: trace
      - name: log.path
        value: ${sys:APP_HOME}/logs
      - name: project.name
        value: ${sys:current.app.name}

  Appenders:
    Console:  #输出到控制台
      name: CONSOLE
      target: SYSTEM_OUT
      PatternLayout:
        Pattern: '[%d] %p [${project.name}] %c{1} [%l] %M [%t] -- %m%n'
    RollingFile: # 输出到文件，超过128MB归档
      - name: infoRollingFile
        ThresholdFilter:
          level: info
          onMatch: ACCEPT
          onMismatch: DENY
        ignoreExceptions: false
        fileName: ${log.path}/${project.name}/info.log
        filePattern: ${log.path}/${project.name}/info.%d{yyyy-MM-dd}.log
        PatternLayout:
          pattern: '[%d] %p [${project.name}] %c{1} %M [%t] [%X{reqId}] -- %m%n'
        Policies:
          SizeBasedTriggeringPolicy:
            size: "128 MB"
          TimeBasedTriggeringPolicy:
            interval: 1
            modulate: true
      - name: errorRollingFile
        ThresholdFilter:
          level: error
          onMatch: ACCEPT
          onMismatch: DENY
        ignoreExceptions: false
        fileName: ${log.path}/${project.name}/error.log
        filePattern: ${log.path}/${project.name}/err.%d{yyyy-MM-dd}.log
        PatternLayout:
          pattern: '[%d]\t%p\t[${project.name}]\t%c{1}\t%M\t[%t]\t[%X{reqId}]\t--\t%m%n'
        Policies:
          SizeBasedTriggeringPolicy:
            size: "128 MB"
          TimeBasedTriggeringPolicy:
            interval: 1
            modulate: true
      - name: warnRollingFile
        ThresholdFilter:
          level: warn
          onMatch: ACCEPT
          onMismatch: DENY
        ignoreExceptions: false
        fileName: ${log.path}/${project.name}/access.log
        filePattern: ${log.path}/${project.name}/warn.%d{yyyy-MM-dd}.log
        PatternLayout:
          pattern: '[%d]\t%p\t[${project.name}]\t--\t%m%n'
        Policies:
          SizeBasedTriggeringPolicy:
            size: "128 MB"
          TimeBasedTriggeringPolicy:
            interval: 1
            modulate: true
  Loggers:
    Root:
      level: info
      AppenderRef:
        - ref: CONSOLE
        - ref: infoRollingFile
        - ref: errorRollingFile
        - ref: warnRollingFile
