-
Notifications
You must be signed in to change notification settings - Fork 435
Use metadata in log messages #720
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
Conversation
Motivation: I was analyzing some logs produced by grpc-swift but some of the messages lack structure, making it more difficult than it should be to run queries on the logs. SwiftLog supports structured logging and its API allow us to log a message and some metadata associated to it. Keeping the message string constant and logging the variable pieces of information as metadata, the logs produced by grpc-swift are going to be more easily analysed and processed. Modifications: This commit changes the logging calls where we had a variable message to have a constant message. The variable pieces of information are stored as metadata. Result: grpc-swift will produce log messages that can be analyzed and processed more easily.
|
|
glbrntt
left a comment
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.
Thanks @mariosangiorgio -- I left a couple of casing suggestions inline, looks great otherwise.
Co-Authored-By: George Barnett <gbrntt@gmail.com>
Co-Authored-By: George Barnett <gbrntt@gmail.com>
Co-Authored-By: George Barnett <gbrntt@gmail.com>
|
@glbrntt thanks for spotting the wrong casing and the suggested fixed! |
glbrntt
left a comment
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.
LGTM, thanks @mariosangiorgio

Motivation:
I was analyzing some logs produced by grpc-swift but some of the messages lack structure, making it more difficult than it should be to run queries on the logs.
SwiftLog supports structured logging and its API allow us to log a message and some metadata associated to it.
Keeping the message string constant and logging the variable pieces of information as metadata, the logs produced by grpc-swift are going to be more easily analysed and processed.
Modifications:
This commit changes the logging calls where we had a variable message to have a constant message. The variable pieces of information are stored as metadata.
Result:
grpc-swift will produce log messages that can be analyzed and processed more easily.