feat(hocon): convert config format of rpc and log to hocon

This commit is contained in:
zhouzb 2021-07-02 13:54:37 +08:00 committed by turtleDeng
parent 092c5455c8
commit c7cbe819ed
1 changed files with 253 additions and 250 deletions

View File

@ -316,13 +316,15 @@ node: {
backtrace_depth: 16 backtrace_depth: 16
} }
##--------------------------------------------------------------------
## RPC
##--------------------------------------------------------------------
## CONFIG_SECTION_BGN=rpc ====================================================== rpc: {
## RPC Mode. ## RPC Mode.
## ##
## Value: sync | async ## Value: sync | async
rpc.mode = async mode: async
## Max batch size of async RPC requests. ## Max batch size of async RPC requests.
## ##
@ -330,7 +332,7 @@ rpc.mode = async
## Zero or negative value disables rpc batching. ## Zero or negative value disables rpc batching.
## ##
## NOTE: RPC batch won't work when rpc.mode = sync ## NOTE: RPC batch won't work when rpc.mode = sync
rpc.async_batch_size = 256 async_batch_size: 256
## RPC port discovery ## RPC port discovery
## ##
@ -343,7 +345,7 @@ rpc.async_batch_size = 256
## then the listening port will be `5370 + <N>` ## then the listening port will be `5370 + <N>`
## ##
## Defaults to `stateless`. ## Defaults to `stateless`.
rpc.port_discovery = stateless port_discovery: stateless
## TCP port number for RPC server to listen on. ## TCP port number for RPC server to listen on.
## ##
@ -352,68 +354,70 @@ rpc.port_discovery = stateless
## NOTE: All nodes in the cluster should agree to this same config. ## NOTE: All nodes in the cluster should agree to this same config.
## ##
## Value: Port [1024-65535] ## Value: Port [1024-65535]
#rpc.tcp_server_port = 5369 ## tcp_server_port: 5369
## Number of outgoing RPC connections. ## Number of outgoing RPC connections.
## ##
## Value: Interger [0-256] ## Value: Interger [0-256]
## Default = 1 ## Default: 1
#rpc.tcp_client_num = 1 ## tcp_client_num: 1
## RCP Client connect timeout. ## RCP Client connect timeout.
## ##
## Value: Seconds ## Value: Seconds
rpc.connect_timeout = 5s connect_timeout: 5s
## TCP send timeout of RPC client and server. ## TCP send timeout of RPC client and server.
## ##
## Value: Seconds ## Value: Seconds
rpc.send_timeout = 5s send_timeout: 5s
## Authentication timeout ## Authentication timeout
## ##
## Value: Seconds ## Value: Seconds
rpc.authentication_timeout = 5s authentication_timeout: 5s
## Default receive timeout for call() functions ## Default receive timeout for call() functions
## ##
## Value: Seconds ## Value: Seconds
rpc.call_receive_timeout = 15s call_receive_timeout: 15s
## Socket idle keepalive. ## Socket idle keepalive.
## ##
## Value: Seconds ## Value: Seconds
rpc.socket_keepalive_idle = 900s socket_keepalive_idle: 900s
## TCP Keepalive probes interval. ## TCP Keepalive probes interval.
## ##
## Value: Seconds ## Value: Seconds
rpc.socket_keepalive_interval = 75s socket_keepalive_interval: 75s
## Probes lost to close the connection ## Probes lost to close the connection
## ##
## Value: Integer ## Value: Integer
rpc.socket_keepalive_count = 9 socket_keepalive_count: 9
## Size of TCP send buffer. ## Size of TCP send buffer.
## ##
## Value: Bytes ## Value: Bytes
rpc.socket_sndbuf = 1MB socket_sndbuf: 1MB
## Size of TCP receive buffer. ## Size of TCP receive buffer.
## ##
## Value: Seconds ## Value: Seconds
rpc.socket_recbuf = 1MB socket_recbuf: 1MB
## Size of user-level software socket buffer. ## Size of user-level software socket buffer.
## ##
## Value: Seconds ## Value: Seconds
rpc.socket_buffer = 1MB socket_buffer: 1MB
}
## CONFIG_SECTION_END=rpc ====================================================== ##--------------------------------------------------------------------
## Log
## CONFIG_SECTION_BGN=logger =================================================== ##--------------------------------------------------------------------
log: {
## Where to emit the logs. ## Where to emit the logs.
## Enable the console (standard output) logs. ## Enable the console (standard output) logs.
## ##
@ -421,7 +425,7 @@ rpc.socket_buffer = 1MB
## - file: write logs only to file ## - file: write logs only to file
## - console: write logs only to standard I/O ## - console: write logs only to standard I/O
## - both: write logs both to file and standard I/O ## - both: write logs both to file and standard I/O
log.to = file to: file
## The log severity level. ## The log severity level.
## ##
@ -431,19 +435,19 @@ log.to = file
## this level will be logged. ## this level will be logged.
## ##
## Default: warning ## Default: warning
log.level = warning level: warning
## Timezone offset to display in logs ## Timezone offset to display in logs
## Value: ## Value:
## - "system" use system zone ## - "system" use system zone
## - "utc" for Universal Coordinated Time (UTC) ## - "utc" for Universal Coordinated Time (UTC)
## - "+hh:mm" or "-hh:mm" for a specified offset ## - "+hh:mm" or "-hh:mm" for a specified offset
log.time_offset = system time_offset: system
## The dir for log files. ## The dir for log files.
## ##
## Value: Folder ## Value: Folder
log.dir = "{{ platform_log_dir }}" dir: "{{ platform_log_dir }}"
## The log filename for logs of level specified in "log.level". ## The log filename for logs of level specified in "log.level".
## ##
@ -452,49 +456,49 @@ log.dir = "{{ platform_log_dir }}"
## ##
## Value: String ## Value: String
## Default: emqx.log ## Default: emqx.log
log.file = emqx.log file: emqx.log
## Limits the total number of characters printed for each log event. ## Limits the total number of characters printed for each log event.
## ##
## Value: Integer ## Value: Integer
## Default: No Limit ## Default: No Limit
#log.chars_limit = 8192 ## chars_limit: 8192
## Maximum depth for Erlang term log formatting ## Maximum depth for Erlang term log formatting
## and Erlang process message queue inspection. ## and Erlang process message queue inspection.
## ##
## Value: Integer or 'unlimited' (without quotes) ## Value: Integer or 'unlimited' (without quotes)
## Default: 80 ## Default: 80
#log.max_depth = 80 ## max_depth: 80
## Log formatter ## Log formatter
## Value: text | json ## Value: text | json
#log.formatter = text ## formatter: text
## Log to single line ## Log to single line
## Value: Boolean ## Value: Boolean
#log.single_line = true ## single_line: true
## Enables the log rotation. ## Enables the log rotation.
## With this enabled, new log files will be created when the current ## With this enabled, new log files will be created when the current
## log file is full, max to `log.rotation.size` files will be created. ## log file is full, max to `rotation.size` files will be created.
## ##
## Value: on | off ## Value: on | off
## Default: on ## Default: on
log.rotation.enable = on rotation.enable: on
## Maximum size of each log file. ## Maximum size of each log file.
## ##
## Value: Number ## Value: Number
## Default: 10M ## Default: 10M
## Supported Unit: KB | MB | GB ## Supported Unit: KB | MB | GB
log.rotation.size = 10MB rotation.size: 10MB
## Maximum rotation count of log files. ## Maximum rotation count of log files.
## ##
## Value: Number ## Value: Number
## Default: 5 ## Default: 5
log.rotation.count = 5 rotation.count: 5
## To create additional log files for specific log levels. ## To create additional log files for specific log levels.
## ##
@ -505,8 +509,8 @@ log.rotation.count = 5
## Note: Log files for a specific log level will only contain all the logs ## Note: Log files for a specific log level will only contain all the logs
## that higher than or equal to that level ## that higher than or equal to that level
## ##
#log.info.file = info.log ## info.file: info.log
#log.error.file = error.log ## error.file: error.log
## The max allowed queue length before switching to sync mode. ## The max allowed queue length before switching to sync mode.
## ##
@ -515,7 +519,7 @@ log.rotation.count = 5
## ##
## Default: 100 ## Default: 100
## ##
#log.sync_mode_qlen = 100 ## sync_mode_qlen: 100
## The max allowed queue length before switching to drop mode. ## The max allowed queue length before switching to drop mode.
## ##
@ -525,7 +529,7 @@ log.rotation.count = 5
## ##
## Default: 3000 ## Default: 3000
## ##
#log.drop_mode_qlen = 3000 ## drop_mode_qlen: 3000
## The max allowed queue length before switching to flush mode. ## The max allowed queue length before switching to flush mode.
## ##
@ -536,7 +540,7 @@ log.rotation.count = 5
## ##
## Default: 8000 ## Default: 8000
## ##
#log.flush_qlen = 8000 ## flush_qlen: 8000
## Kill the log handler when it gets overloaded. ## Kill the log handler when it gets overloaded.
## ##
@ -548,7 +552,7 @@ log.rotation.count = 5
## ##
## Default: on ## Default: on
## ##
#log.overload_kill = on ## overload_kill: on
## The max allowed queue length before killing the log hanlder. ## The max allowed queue length before killing the log hanlder.
## ##
@ -558,7 +562,7 @@ log.rotation.count = 5
## ##
## Default: 20000 ## Default: 20000
## ##
#log.overload_kill_qlen = 20000 ## overload_kill_qlen: 20000
## The max allowed memory size before killing the log hanlder. ## The max allowed memory size before killing the log hanlder.
## ##
@ -568,7 +572,7 @@ log.rotation.count = 5
## ##
## Default: 30MB ## Default: 30MB
## ##
#log.overload_kill_mem_size = 30MB ## overload_kill_mem_size: 30MB
## Restart the log hanlder after some seconds. ## Restart the log hanlder after some seconds.
## ##
@ -578,7 +582,7 @@ log.rotation.count = 5
## ##
## Default: 5s ## Default: 5s
## ##
#log.overload_kill_restart_after = 5s ## overload_kill_restart_after: 5s
## Max burst count and time window for burst control. ## Max burst count and time window for burst control.
## ##
@ -600,9 +604,8 @@ log.rotation.count = 5
## Value: MaxBurstCount,TimeWindow ## Value: MaxBurstCount,TimeWindow
## Default: disabled ## Default: disabled
## ##
#log.burst_limit = "20000, 1s" ## burst_limit: "20000, 1s"
}
## CONFIG_SECTION_END=logger ===================================================
##-------------------------------------------------------------------- ##--------------------------------------------------------------------
## Authentication/Access Control ## Authentication/Access Control