Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

日志配置问题 #176

Open
ugenehan opened this issue Aug 30, 2024 · 1 comment
Open

日志配置问题 #176

ugenehan opened this issue Aug 30, 2024 · 1 comment

Comments

@ugenehan
Copy link

如果sink中不配置format,会使用pattern_formatter-inl.h中的配置,例如以下配置,sinks中如果不配置format,不会使用default的format
plugins:
log:
default:
- name: default# 可以默认的default,可以使用其他的logger名
format: "[%Y-%m-%d %H:%M:%S.%e] [thread %t] [%l] [%@] %v"
sinks:
local_file: # 本地日志的sink
roll_type: by_size # 输出本地日志模式
eol: true # 每次输出是否自动换行。默认换行
filename: /usr/local/trpc/bin/log_by_size.log # 日志文件名,包含路径(相对或绝对路径), 默认为trpc.log
roll_size: 10000 # 输出单个文件大小,默认100M
reserve_count: 5 # 输出本地日志滚动文件个数,默认9个

@raychen911
Copy link
Contributor

raychen911 commented Sep 9, 2024

是存在这个问题,当sink中不配置format的时候不会使用default中的format,我们这边修改一下

pr: #180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants