跳到主要内容

客户端日志

配置示例

# orbien.toml
[log]
level = "info"
path = "logs"
name = "orbien.log"
archive_pattern = "orbien.%d{yyyy-MM-dd}.log"
log_pattern = "%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n"
max_history = 7
total_size_cap = "10MB"

参数说明

参数名类型默认值描述
levelStringinfo根日志级别,如 trace / debug / info / warn / error
pathStringlog日志目录
nameStringorbien.log当前写入的日志文件名
archive_patternStringorbien.%d{yyyy-MM-dd}.log按天滚动的归档文件名模式(相对 path
log_patternString见上例单行日志格式(Logback Pattern)
max_historyInteger30归档保留天数
total_size_capString3GB日志总占用上限,如 50MB3GB