-
Notifications
You must be signed in to change notification settings - Fork 515
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
feat: Enable to save slowlog in logfile #2823
base: unstable
Are you sure you want to change the base?
Conversation
It's a good idea, thanks! |
src/stats/log_collector.cc
Outdated
// json format | ||
auto log = fmt::format("[slowlog] {{\"id\":{}, \"timestamp\":{}, \"duration\":{}, \"cmd\":\"{}\", " | ||
"\"ip\":\"{}\", \"port\":{}, \"client_name\":\"{}\"}}", | ||
entry->id, entry->time, entry->duration, cmd, entry->ip, entry->port, entry->client_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm in other places we don't use JSON format in logs, so maybe we should consider if we want to use JSON format in log here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@greatsharp I think it's already distinguished since the lines have the [slowlog]
prefix. What @PragmaTwice might suggested was to introduce one more option to specify the slow log format (for example, "text" (default) or "json"). WDYT, @PragmaTwice ?
|
No description provided.