logo icon
洁骏Lib库App配置文件说明

洁骏Lib库App配置文件说明 创建时间:2026-10-31 07:20:37

App配置,配置可以支持文件形式和nacos形式混合

  1. 使用文件配置
env: test
app:
  name: Webhook
  type: web
  logger:
    level: debug
    encoding: json
    outputPaths:
      - stdout
      - logs/webhook
    errorOutputPaths:
      - stderr
    initialFields:
      app: Webhook
    encoderConfig:
      #messageKey: msg
      levelKey: level
      nameKey: name
      TimeKey: time
      #CallerKey: caller
      #FunctionKey: func
      StacktraceKey: stacktrace
      LineEnding: "\n"
  errlog:
    level: warn
    encoding: json
    outputPaths:
      - stdout
      #- logs/webhook
    errorOutputPaths:
      - stderr
    initialFields:
      app: Webhook
    encoderConfig:
      #messageKey: msg
      levelKey: level
      nameKey: name
      TimeKey: time
      CallerKey: caller
      FunctionKey: func
      StacktraceKey: stacktrace
      LineEnding: "\n"
redis:
-
  name: pubRedis
  address: [ "pubredis:6379" ]
  user:
  pwd:
  master:
mysql:
-
  name: pubMysql
  address: pubmysql
  port: 3306
  user: test
  pwd: *******
  ssl: disable
  db: ch123
  sql_log: yes
  read_timeout: 100
  conn_timeout: 100
  write_timeout: 100
  char_set: utf8mb4
  max_idle_conns: 10
  max_open_conns: 500
pulsar:
-
  name: pubPulsar
  address: [ "pubpulsar:6650" ]
nacos:
-
  name: nacosConf
  url: http://nacosconf:8848/nacos
  contextPath: /nacos
  ns: public
  user: dev
  pwd: ******
  redis:
    name: base
    address: [ "pubEs:6379" ]
    user:
    pwd:
    master:
elastic:
-
  name: pubEs
  host: [ "pubEs:9200" ]
  user: elastic
  pwd: SLmOE+pJcwsxbFrf-rzh
  read_timeout: 600ms
  conn_timeout: 80ms
  default_max_window_result: 0
  default_track_total_hits: 0
  auto_detect: false
  max_window_result:
    test: 1000
  track_total_hits:
    test: 2000
  1. 使用nacos 配置
env: test
app:
  name: Webhook
  type: web
  logger:
    level: debug
    encoding: json
    outputPaths:
      - stdout
      - logs/webhook
    errorOutputPaths:
      - stderr
    initialFields:
      app: Webhook
    encoderConfig:
      #messageKey: msg
      levelKey: level
      nameKey: name
      TimeKey: time
      #CallerKey: caller
      #FunctionKey: func
      StacktraceKey: stacktrace
      LineEnding: "\n"
  errlog:
    level: warn
    encoding: json
    outputPaths:
      - stdout
      #- logs/webhook
    errorOutputPaths:
      - stderr
    initialFields:
      app: Webhook
    encoderConfig:
      #messageKey: msg
      levelKey: level
      nameKey: name
      TimeKey: time
      CallerKey: caller
      FunctionKey: func
      StacktraceKey: stacktrace
      LineEnding: "\n"
redisNacos:
  name: nacosConf
  did: redis
  group: redis
  ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712
mysqlNacos:
  name: nacosConf
  did: mysql
  group: mysql
  ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712
pulsarNacos:
  name: nacosConf
  did: pulsar
  group: pulsar
  ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712
topicNacos:
-
  name: nacosConf
  did: topic
  group: topic
  ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712
elasticNacos:
  name: nacosConf
  did: elastic
  group: elastic
  ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712
nacos:
-
  name: nacosConf
  url: http://nacosconf:8848/nacos
  contextPath: /nacos
  ns: 62c3bcf9-7948-4c26-a353-cebc0a7c9712
  user: dev
  pwd: 123456
  redis:
    name: base
    address: [ "pubEs:6379" ]
    user:
    pwd:
    master:
  1. nacos 配置截图 nacos 配置说明

1) redis在nacos的配置 redis配置 2) mysql在nacos的配置 mysql在nacos中的配置 3) pulsar在nacos中的配置 pulsar的配置 4) topic在nacos中的配置 topic的配置 5) elastic在nacos中的配置 elastic的配置