【3FS】toml格式
toml格式
[[common.log.categories]]
categories = [ '.' ]
handlers = [ 'normal', 'err', 'fatal' ]
inherit = true
level = 'INFO'
propagate = 'NONE'
[[common.log.handlers]]
async = true
file_path = '/var/log/3fs/storage_main.log'
max_file_size = '100MB'
max_files = 10
name = 'normal'
rotate = true
rotate_on_open = false
start_level = 'NONE'
stream_type = 'STDERR'
writer_type = 'FILE'
[[common.log.handlers]]
async = false
file_path = '/var/log/3fs/storage_main-err.log'
max_file_size = '100MB'
max_files = 10
name = 'err'
rotate = true
rotate_on_open = false
start_level = 'ERR'
stream_type = 'STDERR'
writer_type = 'FILE'
[[common.log.handlers]]
async = false
file_path = '/var/log/3fs/storage_main-fatal.log'
max_file_size = '100MB'
max_files = 10
name = 'fatal'
rotate = true
rotate_on_open = false
start_level = 'FATAL'
stream_type = 'STDERR'
writer_type = 'STREAM'
等价于json:
{
"common": {
"log": {
"categories": [
{
"categories": ["."],
"handlers": ["normal", "err", "fatal"],
"inherit": true,
"level": "INFO",
"propagate": "NONE"
}
],
"handlers": [
{
"async": true,
"file_path": "/var/log/3fs/storage_main.log",
"max_file_size": "100MB",
"max_files": 10,
"name": "normal",
"rotate": true,
"rotate_on_open": false,
"start_level": "NONE",
"stream_type": "STDERR",
"writer_type": "FILE"
},
{
"async": false,
"file_path": "/var/log/3fs/storage_main-err.log",
"max_file_size": "100MB",
"max_files": 10,
"name": "err",
"rotate": true,
"rotate_on_open": false,
"start_level": "ERR",
"stream_type": "STDERR",
"writer_type": "FILE"
},
{
"async": false,
"file_path": "/var/log/3fs/storage_main-fatal.log",
"max_file_size": "100MB",
"max_files": 10,
"name": "fatal",
"rotate": true,
"rotate_on_open": false,
"start_level": "FATAL",
"stream_type": "STDERR",
"writer_type": "STREAM"
}
]
}
}
}
配置2:
[common.memory]
prof_active = false
prof_prefix = ''
[common.monitor]
collect_period = '1s'
num_collectors = 1
[[common.monitor.reporters]]
type = 'monitor_collector'
[common.monitor.reporters.monitor_collector]
remote_ip = ""
等价结构大概是:
{
"common": {
"memory": {
"prof_active": false,
"prof_prefix": ""
},
"monitor": {
"collect_period": "1s",
"num_collectors": 1,
"reporters": [
{
"type": "monitor_collector",
"monitor_collector": {
"remote_ip": ""
}
}
]
}
}
}

浙公网安备 33010602011771号